From 1ed03b3f0b648661704d4f8952669781d168f146 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 15 Jun 2009 12:55:17 +0900 Subject: [PATCH] replace unprintable chars when showing an error --- ankiqt/ui/main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index 263a099dc..2aac1dd1d 100755 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -150,7 +150,7 @@ class AnkiQt(QMainWindow): def getError(self): p = self.pool self.pool = "" - return p + return unicode(p, 'utf8', 'replace') self.errorPipe = ErrorPipe(self) sys.stderr = self.errorPipe @@ -194,10 +194,7 @@ Please do not file a bug report with Anki.
""") diag.setLayout(layout) text = QTextEdit() text.setReadOnly(True) - try: - text.setHtml(txt + "
" + error + "
") - except: - text.setHtml("couldn't set error") + text.setHtml(txt + "
" + error + "
") layout.addWidget(text) box = QDialogButtonBox(QDialogButtonBox.Close) layout.addWidget(box)