From d3366d969dbae914c118f1e6813d8c6cebb62429 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Feb 2009 10:34:14 -0800 Subject: [PATCH] IGN:Handle non ascii device error messages better --- src/calibre/gui2/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 84e4be699c..b4049fc739 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -1355,10 +1355,13 @@ class Main(MainWindow, Ui_MainWindow): ''' Handle exceptions in threaded device jobs. ''' - if 'Could not read 32 bytes on the control bus.' in str(job.exception): - error_dialog(self, _('Error talking to device'), - _('There was a temporary error talking to the device. Please unplug and reconnect the device and or reboot.')).show() - return + try: + if 'Could not read 32 bytes on the control bus.' in unicode(job.exception): + error_dialog(self, _('Error talking to device'), + _('There was a temporary error talking to the device. Please unplug and reconnect the device and or reboot.')).show() + return + except: + pass try: print >>sys.stderr, job.console_text() except: