mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
work around intercepted connections
This commit is contained in:
parent
2b34f1f653
commit
c25b68fd87
1 changed files with 7 additions and 1 deletions
|
@ -66,7 +66,13 @@ Error was:<pre>%s</pre>""")
|
||||||
sock = urllib2.urlopen(
|
sock = urllib2.urlopen(
|
||||||
URL + "search?t=%d&c=1" % self.type)
|
URL + "search?t=%d&c=1" % self.type)
|
||||||
data = sock.read()
|
data = sock.read()
|
||||||
data = gzip.GzipFile(fileobj=cStringIO.StringIO(data)).read()
|
try:
|
||||||
|
data = gzip.GzipFile(fileobj=cStringIO.StringIO(data)).read()
|
||||||
|
except:
|
||||||
|
# the server is sending gzipped data, but a transparent
|
||||||
|
# proxy or antivirus software may be decompressing it
|
||||||
|
# before we get it
|
||||||
|
pass
|
||||||
self.allList = simplejson.loads(unicode(data))
|
self.allList = simplejson.loads(unicode(data))
|
||||||
except:
|
except:
|
||||||
showInfo(self.conErrMsg % cgi.escape(unicode(
|
showInfo(self.conErrMsg % cgi.escape(unicode(
|
||||||
|
|
Loading…
Reference in a new issue