Message174131
| 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:50 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, amaury.forgeotdarc, nadeem.vawda |
| 2012年10月29日 16:50:50 | serhiy.storchaka | set | messageid: <1351529450.55.0.478247493767.issue16350@psf.upfronthosting.co.za> |
| 2012年10月29日 16:50:50 | serhiy.storchaka | link | issue16350 messages |
| 2012年10月29日 16:50:50 | serhiy.storchaka | create |
|