[issue5784] raw deflate format and zlib module

paul rubin report at bugs.python.org
Sat Apr 18 00:10:21 CEST 2009


New submission from paul rubin <phr at users.sourceforge.net>:

The zlib module doesn't support raw deflate format, so it doesn't
completely interoperate with php's "gzdeflate" function and fails to
decompress some strings that web browsers can decompress.

A workaround is to use a special zlib feature and pass the value -15 as
the "wbits" arg: 

plaintext = zlib.deflate(compressed_text, wbits=-15)

I don't know if it's appropriate to mess with the code, but at minimum I
urge that the workaround be mentioned in the docs.  We had a tremendous
distruption where I work because of a malicious raw-deflated PHP script
that we couldn't decompress with Python for analysis.  We had to resort
to decompressing in a PHP container that (through my slipping up) it
proceeded to escape from.  

Help us Python-Kenobi, save us from PHP ;-)

----------
messages: 86094
nosy: phr
severity: normal
status: open
title: raw deflate format and zlib module

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5784>
_______________________________________


More information about the Python-bugs-list mailing list