From 5cbed9ff4cbd4a96181d8c339d1cabdf23db6c45 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 23 Aug 2012 10:04:36 +0530 Subject: [PATCH] Don't popup an error dialog if the user's network returns a non utf-8 string when checking for the latest version --- src/calibre/gui2/update.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/update.py b/src/calibre/gui2/update.py index 42d41e6d72..a7bc341a96 100644 --- a/src/calibre/gui2/update.py +++ b/src/calibre/gui2/update.py @@ -27,6 +27,10 @@ def get_newest_version(): 'win' if iswindows else 'osx' if isosx else 'oth') req.add_header('CALIBRE_INSTALL_UUID', prefs['installation_uuid']) version = br.open(req).read().strip() + try: + version = version.decode('utf-8') + except UnicodeDecodeError: + version = u'' return version class CheckForUpdates(QThread):