Message105420
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. |
|
Date |
User |
Action |
Args |
2010-05-09 22:44:06 | matthew.brett | set | recipients:
+ matthew.brett |
2010-05-09 22:44:06 | matthew.brett | set | messageid: <1273445046.81.0.821535662262.issue8672@psf.upfronthosting.co.za> |
2010-05-09 22:44:02 | matthew.brett | link | issue8672 messages |
2010-05-09 22:44:01 | matthew.brett | create | |
|