[New-bugs-announce] [issue8672] Error decompressing valid zlib data

Matthew Brett report at bugs.python.org
Mon May 10 00:44:06 CEST 2010


New submission from Matthew Brett <matthew.brett at gmail.com>:

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.

----------
components: IO
files: mat.bin
messages: 105420
nosy: matthew.brett
priority: normal
severity: normal
status: open
title: Error decompressing valid zlib data
type: behavior
versions: Python 2.6, Python 3.1
Added file: http://bugs.python.org/file17279/mat.bin

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


More information about the New-bugs-announce mailing list