zlib.decompress cannot, gunzip can

Dima Dorfman dima at trit.invalid
Tue Mar 1 00:49:34 EST 2005


On 2005-03-01, enrio at online.no <enrio at online.no> wrote:
> I have a string which I try to decompress:
>
>   body = zlib.decompress(body)
>
> but I get
>
>   zlib.error: Error -3 while decompressing data: incorrect header check
>
> However, I can write the string to a file and run gunzip with the
> expected results:

gzip files have a header preceding the zlib stream. Try the gzip module.



More information about the Python-list mailing list