MCPcopy Index your code
hub / github.com/pyload/pyload / verify

Method verify

module/plugins/internal/UnZip.py:60–75  ·  view source on GitHub ↗
(self, password=None)

Source from the content-addressed store, hash-verified

58 return self.files
59
60 def verify(self, password=None):
61 try:
62 with zipfile.ZipFile(self.filename, 'r') as z:
63 z.setpassword(password)
64 badfile = z.testzip()
65 if badfile is not None:
66 raise CRCError(badfile)
67
68 except (zipfile.BadZipfile, zipfile.LargeZipFile), e:
69 raise ArchiveError(e)
70
71 except RuntimeError, e:
72 if "encrypted" in e.args[0] or "Bad password" in e.args[0]:
73 raise PasswordError(e)
74 else:
75 raise CRCError(e)
76
77 def extract(self, password=None):
78 self.verify(password)

Callers 1

extractMethod · 0.95

Calls 3

CRCErrorClass · 0.85
ArchiveErrorClass · 0.85
PasswordErrorClass · 0.85

Tested by

no test coverage detected