Explorar el Código

Merge branch 'bugfix/fix_idf_monitor_unicode_path_crash_v4.1' into 'release/v4.1'

tools: handle exception in case of logging Unicode characters (v4.1)

See merge request espressif/esp-idf!13043
Ivan Grokhotkov hace 4 años
padre
commit
92aed6c759
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      tools/idf_monitor.py

+ 3 - 0
tools/idf_monitor.py

@@ -920,6 +920,9 @@ if os.name == 'nt':
                 # Also possible for Windows to throw an OSError error if the data is invalid for the console
                 # (garbage bytes, etc)
                 pass
+            except UnicodeDecodeError:
+                # In case of double byte Unicode characters display '?'
+                self.output.write('?')
 
         def write(self, data):
             if isinstance(data, bytes):