summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-10-24 12:31:13 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-10-24 12:31:13 -1000
commit43264e5908f18ad393da2fa7fd975057b364fa23 (patch)
tree53ace60c24edfd33f1117b39f6222c5d512723f3 /gui.py
parentf92daebe85291cba6bb447903831136b9339dcde (diff)
downloadanaconda-43264e5908f18ad393da2fa7fd975057b364fa23.tar.gz
anaconda-43264e5908f18ad393da2fa7fd975057b364fa23.tar.xz
anaconda-43264e5908f18ad393da2fa7fd975057b364fa23.zip
Catch UnicodeDecodeError so traceback messages display anyway.
I've seen this happen in recent nightly builds. UnicodeDecodeError gets thrown by unicode() and the traceback window doesn't finish rendering and we get two tracebacks dumped to the console, one for the traceback window tracebacking and the original one we were going to display. This workaround at least gets us traceback windows displaying. I don't know enough about unicode() to do anything more with it right now, so this seems reasonable. If the exception is thrown, I log a message so we have some record of the unicode failure. My guess is that the i18n files are invalid and/or incompatible with what we're trying to shove them through in Python. But that's just a guess.
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gui.py b/gui.py
index 0f271f26b..98aaa4562 100755
--- a/gui.py
+++ b/gui.py
@@ -1056,7 +1056,11 @@ class DetailedMessageWindow(MessageWindow):
for line in longText:
if __builtins__.get("type")(line) != unicode:
- line = unicode(line, encoding='utf-8')
+ try:
+ line = unicode(line, encoding='utf-8')
+ except UnicodeDecodeError, e:
+ log.error("UnicodeDecodeException: line = %s" % (line,))
+ log.error("UnicodeDecodeException: %s" % (str(e),))
textbuf.insert(iter, line)