Zlib: correct checksum but error decompressing

Paul Rubin http
Wed Aug 26 23:57:25 CEST 2009

Andre <andre.cohen at gmail.com> writes:
> I have been trying to solve this issue for a while now. I receive data
> from a TCP connection which is compressed.

Are you sure it is compressed with zlib?  If yes, does it include the
standard zlib header?  Some applications save a few bytes by stripping
the header.  See the zlib doc page for how to deal with that, there is
a flag that causes the header check to be skipped on decompression if
you pass a negative number.  That's the first thing I would try.

More information about the Python-list mailing list