tools: handle exception in case of logging Unicode characters

This commit is contained in:
Juraj Michálek 2021-02-25 18:09:48 +01:00
parent aff0235e47
commit 181a2389dc

View File

@ -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):