This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author matthew.brett
Recipients matthew.brett
Date 2010-05-09.22:44:00
SpamBayes Score 4.2863585e-06
Marked as misclassified No
Message-id <1273445046.81.0.821535662262.issue8672@psf.upfronthosting.co.za>
In-reply-to
Content
I have a valid zlib compressed string, attached here as 'mat.bin' (1.7M), that cause and error on zlib.decompress decompression:

>>> import zlib
>>> data = open('mat.bin', 'rb').read()
>>> out = zlib.decompress(data)
Traceback (most recent call last):
  File "<ipython console>", line 1, in <module>
error: Error -5 while decompressing data

I know these data are valid, because I get the string I was expecting with:

>>> dc_obj = zlib.decompressobj()
>>> out = dc_obj.decompress(data)

As expected, there is no remaining data after this read:

>>> assert dc_obj.flush() == ''
>>> 

I believe that the behavior of zlib.decompress(data) and zlib.decompressobj().decompress(data) should be equivalent, and that the error for zlib.decompress(data) is therefore the symptom of a bug.
History
Date User Action Args
2010-05-09 22:44:06matthew.brettsetrecipients: + matthew.brett
2010-05-09 22:44:06matthew.brettsetmessageid: <1273445046.81.0.821535662262.issue8672@psf.upfronthosting.co.za>
2010-05-09 22:44:02matthew.brettlinkissue8672 messages
2010-05-09 22:44:01matthew.brettcreate