New submission from paul rubin <p...@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 <rep...@bugs.python.org> <http://bugs.python.org/issue5784> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com