Pārlūkot izejas kodu

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

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

See merge request espressif/esp-idf!13041
Jiang Jiang Jian 4 gadi atpakaļ
vecāks
revīzija
08c5b89096
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      tools/idf_monitor.py

+ 3 - 0
tools/idf_monitor.py

@@ -1269,6 +1269,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):