Commits

Antonio Cuni committed d38e836

bah, I don't know how to produce bogus zip files for also these cases, but we need to catch RZlibError here as well

Comments (0)

Files changed (1)

pypy/module/zipimport/interp_zipimport.py

             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):
     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:]