Don't popup an error dialog if the user's network returns a non utf-8 string when checking for the latest version

This commit is contained in:
Kovid Goyal 2012-08-23 10:04:36 +05:30
parent 0dcf9a9482
commit 5cbed9ff4c

View File

@ -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):