tests: cli: Handle UnicodeError when logging

This commit is contained in:
Radostin Stoyanov 2017-10-11 12:36:02 +01:00 committed by Cole Robinson
parent 81d68e6100
commit e3d35b2fb9
1 changed files with 2 additions and 0 deletions

View File

@ -132,6 +132,8 @@ class VirtStreamHandler(logging.StreamHandler):
self.flush()
except (KeyboardInterrupt, SystemExit):
raise
except (UnicodeError, TypeError):
stream.write((fs % msg).encode("utf-8"))
except Exception:
self.handleError(record)