From 827ed998ead5e73743963d021a6822b4ed3ea926 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 11 Apr 2013 15:25:59 +0900 Subject: [PATCH] catch unicode errors in debug console (#545) --- aqt/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aqt/main.py b/aqt/main.py index a6d1f0960..7f2af17a1 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -981,7 +981,10 @@ will be lost. Continue?""")) buf += ">>> %s\n" % line else: buf += "... %s\n" % line - frm.log.appendPlainText(buf + (self._output or "")) + try: + frm.log.appendPlainText(buf + (self._output or "")) + except UnicodeDecodeError: + frm.log.appendPlainText(_("")) frm.log.ensureCursorVisible() # System specific code