Владимир Дашивец
unread,Jul 4, 2012, 5:11:40 AM7/4/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to httplib2-dev
Hello.
Please help me, I get "HTTP" request with "Content-Encoding: zip".
Decoding "Deflate" and "gzip" do not help to unpack the contents of
the request.
The file "zip1.txt" contains compressed data from the "HTTP" request.
1.
content = zlib.decompress(open( "zip1.txt", "rb").read())
Error:
Traceback (most recent call last):
File "D:\Install\Python\Project\HTTPClient\HTTPClient.py", line 132,
in <module>
content = zlib.decompress(open( "zip1.txt", "rb").read())
zlib.error: Error -3 while decompressing data: incorrect header check
2.
content = gzip.GzipFile(fileobj=io.BytesIO(open( "zip1.txt",
"rb").read())).read()
Error:
Traceback (most recent call last):
File "D:\Install\Python\Project\HTTPClient\HTTPClient.py", line 130,
in <module>
content = gzip.GzipFile(fileobj=io.BytesIO(open( "zip1.txt",
"rb").read())).read()
File "C:\Python32\lib\gzip.py", line 336, in read
self._read(readsize)
File "C:\Python32\lib\gzip.py", line 390, in _read
self._read_gzip_header()
File "C:\Python32\lib\gzip.py", line 267, in _read_gzip_header
raise IOError('Not a gzipped file')
IOError: Not a gzipped file
Tell me what else you can try or where I was wrong (for example,
extract taken from "httplib2").