mirror of
https://github.com/python/cpython.git
synced 2024-12-11 18:53:56 +08:00
511e2cacc4
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.
15 lines
440 B
Plaintext
15 lines
440 B
Plaintext
test_zlib
|
|
0xe5c1a120 0x43b6aa94
|
|
0xbd602f7 0xbd602f7
|
|
expecting Bad compression level
|
|
expecting Invalid initialization option
|
|
expecting Invalid initialization option
|
|
normal compression/decompression succeeded
|
|
compress/decompression obj succeeded
|
|
decompress with init options succeeded
|
|
decompressobj with init options succeeded
|
|
should be '': ''
|
|
max_length decompressobj succeeded
|
|
unconsumed_tail should be '': ''
|
|
Testing on 17K of random data
|