(self, password=None)
| 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) |
no test coverage detected