MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / testzip

Method testzip

tools/python-3.11.9-amd64/Lib/zipfile.py:1475–1486  ·  view source on GitHub ↗

Read all the files and check the CRC.

(self)

Source from the content-addressed store, hash-verified

1473 file=file)
1474
1475 def testzip(self):
1476 """Read all the files and check the CRC."""
1477 chunk_size = 2 ** 20
1478 for zinfo in self.filelist:
1479 try:
1480 # Read by chunks, to avoid an OverflowError or a
1481 # MemoryError with very large embedded files.
1482 with self.open(zinfo.filename, "r") as f:
1483 while f.read(chunk_size): # Check CRC-32
1484 pass
1485 except BadZipFile:
1486 return zinfo.filename
1487
1488 def getinfo(self, name):
1489 """Return the instance of ZipInfo given 'name'."""

Callers 1

mainFunction · 0.80

Calls 2

openMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected