Index: zipfile.py =================================================================== --- zipfile.py (revisi¢n: 56036) +++ zipfile.py (copia de trabajo) @@ -24,6 +24,7 @@ error = BadZipfile # The exception raised by this module +UNCOMPRESSED_READ_BUFFER = 2 ** 14 ZIP64_LIMIT= (1 << 31) - 1 # constants for Zip file compression methods @@ -713,7 +714,12 @@ """Read all the files and check the CRC.""" for zinfo in self.filelist: try: - self.read(zinfo.filename) # Check CRC-32 + # Check CRC-32. + input = self.open(zinfo.filename) + buf = input.read(UNCOMPRESSED_READ_BUFFER) + while buf: + buf = input.read(UNCOMPRESSED_READ_BUFFER) + input.close() except BadZipfile: return zinfo.filename @@ -1138,8 +1144,11 @@ print USAGE sys.exit(1) zf = ZipFile(args[1], 'r') - zf.testzip() - print "Done testing" + ret = zf.testzip() + if ret: + print "Something went wrong in", ret + else: + print "Done testing" elif args[0] == '-e': if len(args) != 3: