[pypy-commit] pypy py3.5: Backed out changeset a1d41e7ebbb6: should be fixed in rzlib in "default"

arigo pypy.commits at gmail.com
Mon Dec 19 11:50:25 EST 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r89186:cafc329793d4
Date: 2016-12-19 17:17 +0100
http://bitbucket.org/pypy/pypy/changeset/cafc329793d4/

Log:	Backed out changeset a1d41e7ebbb6: should be fixed in rzlib in
	"default"

diff --git a/pypy/module/zlib/interp_zlib.py b/pypy/module/zlib/interp_zlib.py
--- a/pypy/module/zlib/interp_zlib.py
+++ b/pypy/module/zlib/interp_zlib.py
@@ -8,7 +8,6 @@
 
 from rpython.rlib import rzlib
 
-UINT_MAX = 2**32-1
 
 @unwrap_spec(string='bufferstr', start='truncatedint_w')
 def crc32(space, string, start = rzlib.CRC32_DEFAULT_START):
@@ -52,8 +51,6 @@
 
     Optional arg level is the compression level, in 1-9.
     """
-    if len(string) > UINT_MAX:
-        raise oefmt(space.w_OverflowError, "Size does not fit in an unsigned int")
     try:
         try:
             stream = rzlib.deflateInit(level)
@@ -76,8 +73,6 @@
     Optional arg wbits is the window buffer size.  Optional arg bufsize is
     only for compatibility with CPython and is ignored.
     """
-    if len(string) > UINT_MAX:
-        raise oefmt(space.w_OverflowError, "Size does not fit in an unsigned int")
     try:
         try:
             stream = rzlib.inflateInit(wbits)
@@ -152,8 +147,6 @@
 
         Call the flush() method to clear these buffers.
         """
-        if len(data) > UINT_MAX:
-            raise oefmt(space.w_OverflowError, "Size does not fit in an unsigned int")
         try:
             self.lock()
             try:
@@ -284,12 +277,10 @@
         unconsumed_tail attribute.
         """
         if max_length == 0:
-            max_length = UINT_MAX
+            max_length = sys.maxint
         elif max_length < 0:
             raise oefmt(space.w_ValueError,
                         "max_length must be greater than zero")
-        elif len(data) > UINT_MAX:
-            raise oefmt(space.w_OverflowError, "Size does not fit in an unsigned int")
         try:
             self.lock()
             try:


More information about the pypy-commit mailing list