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 serhiy.storchaka
Recipients amaury.forgeotdarc, nadeem.vawda, serhiy.storchaka
Date 2012-10-29.16:50:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351529450.55.0.478247493767.issue16350@psf.upfronthosting.co.za>
In-reply-to
Content
There is yet one memory management bug (with unconsumed_tail).

flush() does not update unconsumed_tail and unused_data.

>>> import zlib
>>> x = zlib.compress(b'abcdefghijklmnopqrstuvwxyz') + b'0123456789'
>>> dco = zlib.decompressobj()
>>> dco.decompress(x, 1)
b'a'
>>> dco.flush()
b'bcdefghijklmnopqrstuvwxyz'
>>> dco.unconsumed_tail
b'NIMK\xcf\xc8\xcc\xca\xce\xc9\xcd\xcb/(,*.)-+\xaf\xa8\xac\x02\x00\x90\x86\x0b 0123456789'
>>> dco.unused_data
b''

What should unconsumed_tail be equal after EOF? b'' or unused_data?

>>> import zlib
>>> x = zlib.compress(b'abcdefghijklmnopqrstuvwxyz') + b'0123456789'
>>> dco = zlib.decompressobj()
>>> dco.decompress(x)
b'abcdefghijklmnopqrstuvwxyz'
>>> dco.flush()
b''
>>> dco.unconsumed_tail
b''
>>> dco.unused_data
b'0123456789'
>>> dco = zlib.decompressobj()
>>> dco.decompress(x, 1000)
b'abcdefghijklmnopqrstuvwxyz'
>>> dco.flush()
b''
>>> dco.unconsumed_tail
b'0123456789'
>>> dco.unused_data
b'0123456789'
History
Date User Action Args
2012-10-29 16:50:50serhiy.storchakasetrecipients: + serhiy.storchaka, amaury.forgeotdarc, nadeem.vawda
2012-10-29 16:50:50serhiy.storchakasetmessageid: <1351529450.55.0.478247493767.issue16350@psf.upfronthosting.co.za>
2012-10-29 16:50:50serhiy.storchakalinkissue16350 messages
2012-10-29 16:50:50serhiy.storchakacreate