diff options
Diffstat (limited to 'log.py')
| -rw-r--r-- | log.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -27,6 +27,10 @@ class Log: stream = sys.stderr else: stream = sys.stdout + if stream.errors == 'strict': + # emulate backslashreplace error handler + encoding = stream.encoding + msg = msg.encode(encoding, "backslashreplace").decode(encoding) stream.write('%s\n' % msg) stream.flush() |
