]> granicus.if.org Git - python/commitdiff
Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressob...
authorNadeem Vawda <nadeem.vawda@gmail.com>
Sun, 11 Nov 2012 01:24:37 +0000 (02:24 +0100)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Sun, 11 Nov 2012 01:24:37 +0000 (02:24 +0100)
Additionally, fix a bug where a MemoryError in allocating a bytes object could
leave the decompressor object in an invalid state (with its unconsumed_tail
member being NULL).

Patch by Serhiy Storchaka.

1  2 
Misc/NEWS
Modules/zlibmodule.c

diff --cc Misc/NEWS
index 6b08b0938a7ef6162b7e8324fc298337fced5a5c,de6ec4f26286d47bdc19c1ae4ed55d93a48e65db..2c80158b1432e3117c7d855fdce6fc98b3ff0695
+++ b/Misc/NEWS
@@@ -124,12 -91,11 +124,14 @@@ Librar
  - Issue #16431: Use the type information when constructing a Decimal subtype
    from a Decimal argument.
  
- - Issue #16350: zlib.Decompress.decompress() now accumulates data from
 +- Issue #15641: Clean up deprecated classes from importlib
 +  Patch by Taras Lyapun.
 +
+ - Issue #16350: zlib.decompressobj().decompress() now accumulates data from
    successive calls after EOF in unused_data, instead of only saving the argument
-   to the last call. Patch by Serhiy Storchaka.
+   to the last call. decompressobj().flush() now correctly sets unused_data and
+   unconsumed_tail. A bug in the handling of MemoryError when setting the
+   unconsumed_tail attribute has also been fixed. Patch by Serhiy Storchaka.
  
  - Issue #12759: sre_parse now raises a proper error when the name of the group
    is missing.  Initial patch by Serhiy Storchaka.
Simple merge