]> granicus.if.org Git - python/commit
[ #403753 ] zlib decompress; uncontrollable memory usage
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 16 Oct 2001 20:39:49 +0000 (20:39 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 16 Oct 2001 20:39:49 +0000 (20:39 +0000)
commit511e2cacc4aa67a83ed7c0ae34355407bdd13c57
tree770b92726208bcae44db86fc8956348fe8d9a91e
parent7a59445e3783fc842bc4fd0181b18d6798883a3e
[ #403753 ] zlib decompress; uncontrollable memory usage

Mostly by Toby Dickenson and Titus Brown.

Add an optional argument to a decompression object's decompress()
method.  The argument specifies the maximum length of the return
value.  If the uncompressed data exceeds this length, the excess data
is stored as the unconsumed_tail attribute.  (Not to be confused with
unused_data, which is a separate issue.)

Difference from SF patch: Default value for unconsumed_tail is ""
rather than None.  It's simpler if the attribute is always a string.
Doc/lib/libzlib.tex
Lib/test/output/test_zlib
Lib/test/test_zlib.py
Modules/zlibmodule.c