cpython: f86a22b6ab58 (original) (raw)

Mercurial > cpython

changeset 70120:f86a22b6ab58

Merge: #8650: Make zlib.[de]compressobj().[de]compress() 64-bit clean. Raise an OverflowError if the input data is too large, instead of silently truncating the input and returning an incorrect result. [#8650]

Nadeem Vawda nadeem.vawda@gmail.com
date Sun, 15 May 2011 00:23:40 +0200
parents 7fb34d30bd59(current diff)3ff862d05d18(diff)
children 599487064aa0
files Misc/NEWS Modules/zlibmodule.c
diffstat 3 files changed, 39 insertions(+), 14 deletions(-)[+] [-] Lib/test/test_zlib.py 11 Misc/NEWS 5 Modules/zlibmodule.c 37

line wrap: on

line diff

--- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -523,6 +523,17 @@ class CompressObjectTestCase(BaseCompres decompress = lambda s: d.decompress(s) + d.flush() self.check_big_decompress_buffer(size, decompress)

+ def genblock(seed, length, step=1024, generator=random): """length-byte stream of random data from a seed (in step-byte blocks)."""

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -147,6 +147,11 @@ Core and Builtins Library ------- +- Issue #8650: Make zlib module 64-bit clean. compress(), decompress() and

--- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -420,22 +420,26 @@ PyDoc_STRVAR(comp_compress__doc__, static PyObject * PyZlib_objcompress(compobject *self, PyObject *args) {

ENTER_ZLIB(self); @@ -484,6 +488,7 @@ PyZlib_objcompress(compobject *self, PyO error: LEAVE_ZLIB(self);

ENTER_ZLIB(self); @@ -621,6 +629,7 @@ PyZlib_objdecompress(compobject *self, P error: LEAVE_ZLIB(self);