catch unicode errors in debug console (#545)

This commit is contained in:
Damien Elmes 2013-04-11 15:25:59 +09:00
parent 5e8f45f7e5
commit 827ed998ea

View File

@ -981,7 +981,10 @@ will be lost. Continue?"""))
buf += ">>> %s\n" % line
else:
buf += "... %s\n" % line
frm.log.appendPlainText(buf + (self._output or "<no output>"))
try:
frm.log.appendPlainText(buf + (self._output or "<no output>"))
except UnicodeDecodeError:
frm.log.appendPlainText(_("<non-unicode text>"))
frm.log.ensureCursorVisible()
# System specific code