From 181a2389dcfc129baeacf1fd62b3c0b20fece0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Thu, 25 Feb 2021 18:09:48 +0100 Subject: [PATCH] tools: handle exception in case of logging Unicode characters --- tools/idf_monitor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/idf_monitor.py b/tools/idf_monitor.py index 18b635e3d0..490178e53a 100755 --- a/tools/idf_monitor.py +++ b/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):