Try this
http://www.paul.sladen.org/projects/pyflate/

2008/9/9 Sam <[EMAIL PROTECTED]>:
> I'm using urllib2 and accepting gzip and deflate.
>
> It turns out that almost every site returns either normal text or
> gzip.  But I finally found one that returns deflate.
>
> Here's how I un-gzip:
>   compressedstream = StringIO.StringIO(data)
>   gzipper = gzip.GzipFile(fileobj=compressedstream)
>   data = gzipper.read()
>
> Un-gzipping works great!
>
> Here's how I un-deflate  (inflate??)
>   data = zlib.decompress(data)
>
> Un-deflating doesn't work.  I get "zlib.error: Error -3 while
> decompressing data: incorrect header check"
>
> I'm using python 2.5.2.  Can someone tell me exactly how to handle
> deflated web pages?
>
> Thanks
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to