Author: Antonio Cuni <[email protected]>
Branch:
Changeset: r68625:d38e836c3945
Date: 2014-01-12 22:00 +0000
http://bitbucket.org/pypy/pypy/changeset/d38e836c3945/
Log: bah, I don't know how to produce bogus zip files for also these
cases, but we need to catch RZlibError here as well
diff --git a/pypy/module/zipimport/interp_zipimport.py
b/pypy/module/zipimport/interp_zipimport.py
--- a/pypy/module/zipimport/interp_zipimport.py
+++ b/pypy/module/zipimport/interp_zipimport.py
@@ -289,6 +289,10 @@
return w(data)
except (KeyError, OSError, BadZipfile):
raise OperationError(space.w_IOError, space.wrap("Error reading
file"))
+ except RZlibError, e:
+ # in this case, CPython raises the direct exception coming
+ # from the zlib module: let's to the same
+ raise zlib_error(space, e.msg)
@unwrap_spec(fullname=str)
def get_code(self, space, fullname):
@@ -387,6 +391,11 @@
except (BadZipfile, OSError):
raise operationerrfmt(get_error(space),
"%s seems not to be a zipfile", filename)
+ except RZlibError, e:
+ # in this case, CPython raises the direct exception coming
+ # from the zlib module: let's to the same
+ raise zlib_error(space, e.msg)
+
prefix = name[len(filename):]
if prefix.startswith(os.path.sep) or prefix.startswith(ZIPSEP):
prefix = prefix[1:]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit