UI/UserInterface.py

branch
5_1_x
changeset 1218
825a24cf43f7
parent 1194
9a54fec8559d
child 1359
97dc4ee2d655
--- a/UI/UserInterface.py	Tue Aug 16 17:07:59 2011 +0200
+++ b/UI/UserInterface.py	Wed Aug 17 19:50:50 2011 +0200
@@ -5483,7 +5483,11 @@
         reply = self.sender()
         if reply in self.__replies:
             self.__replies.remove(reply)
-        if reply.error() != QNetworkReply.NoError:
+        if reply.error() == QNetworkReply.NoError:
+            ioEncoding = Preferences.getSystem("IOEncoding")
+            versions = str(reply.readAll(), ioEncoding, 'replace').splitlines()
+        if reply.error() != QNetworkReply.NoError or versions[0].startswith("<"):
+            # network error or an error page
             self.httpAlternative += 1
             if self.httpAlternative >= len(self.__httpAlternatives):
                 self.__inVersionCheck = False
@@ -5503,8 +5507,6 @@
         if self.__versionCheckProgress is not None:
             self.__versionCheckProgress.reset()
             self.__versionCheckProgress = None
-        ioEncoding = Preferences.getSystem("IOEncoding")
-        versions = str(reply.readAll(), ioEncoding, 'replace').splitlines()
         self.__updateVersionsUrls(versions)
         if self.showAvailableVersions:
             self.__showAvailableVersionInfos(versions)

eric ide

mercurial