Lines Matching refs:ZipFile

69         with zipfile.ZipFile(f, "w", **kwargs) as zipfp:
81 with zipfile.ZipFile(f, "r", compression) as zipfp:
139 with zipfile.ZipFile(f, "r", compression) as zipfp:
166 with zipfile.ZipFile(path, "r", self.compression) as zipfp:
173 with zipfile.ZipFile(f, "r", compression) as zipfp:
192 with zipfile.ZipFile(f, "r") as zipfp, \
211 with zipfile.ZipFile(f, "r") as zipfp, \
231 with zipfile.ZipFile(f, "r") as zipfp, \
256 with zipfile.ZipFile(f, "r") as zipfp:
270 with zipfile.ZipFile(f, "r") as zipfp:
284 with zipfile.ZipFile(f, "r") as zipfp:
296 with zipfile.ZipFile(TESTFN2, "w", self.compression) as zipfp:
300 with zipfile.ZipFile(TESTFN2, "r", self.compression) as zipfp:
306 zipfp = zipfile.ZipFile(TESTFN2, "w")
312 zipfp = zipfile.ZipFile(TESTFN2, "w", compresslevel=1)
333 with zipfile.ZipFile(io.BytesIO(), "w", self.compression) as zipf:
341 with zipfile.ZipFile(fp, mode='w') as zipf:
347 with zipfile.ZipFile(fp) as zipf:
354 with zipfile.ZipFile(fp) as zipf:
362 with zipfile.ZipFile(fp) as zipf:
372 with zipfile.ZipFile(f, 'w', self.compression) as zipfp:
377 with zipfile.ZipFile(f, 'r') as zipfp:
407 with zipfile.ZipFile(TESTFN2, "w", compresslevel=1) as zipfp:
429 with zipfile.ZipFile(testfile, 'w', self.compression) as zipfp:
442 with zipfile.ZipFile(io.BytesIO(testfile.getvalue())) as zipfp:
446 with zipfile.ZipFile(io.BytesIO(testfile.getvalue())) as zipfp:
468 with zipfile.ZipFile(f, "r") as zipfp:
480 with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
483 with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) as zipfp:
488 with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
491 with zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED) as zipfp:
499 data = b'I am not a ZipFile!'*10
503 with zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED) as zipfp:
508 with zipfile.ZipFile(f, "r") as zipfp:
514 with io.BytesIO(zipfiledata) as bio, zipfile.ZipFile(bio) as zipfp:
520 with zipfile.ZipFile(bio, 'w', zipfile.ZIP_STORED) as zipfp:
523 data = b'I am not a ZipFile!'*10
528 with zipfile.ZipFile(TESTFN2) as zipfp:
534 with zipfile.ZipFile(bio, 'w', zipfile.ZIP_STORED) as zipfp:
537 data = b'I am not a ZipFile!'*1000000
542 with zipfile.ZipFile(TESTFN2, 'a') as zipfp:
549 with io.BytesIO(zipfiledata) as bio, zipfile.ZipFile(bio) as zipfp:
555 with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
559 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
560 self.assertIsInstance(zipfp, zipfile.ZipFile)
563 with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
568 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
569 self.assertIsInstance(zipfp, zipfile.ZipFile)
573 """Check that calling ZipFile.write without arcname specified
575 with zipfile.ZipFile(TESTFN2, "w") as zipfp:
582 with zipfile.ZipFile(TESTFN2, mode="w") as zipfp:
585 with zipfile.ZipFile(TESTFN2, mode="r") as zipfp:
595 """Check that trying to call write() on a readonly ZipFile object
597 with zipfile.ZipFile(TESTFN2, mode="w") as zipfp:
600 with zipfile.ZipFile(TESTFN2, mode="r") as zipfp:
603 with zipfile.ZipFile(TESTFN2, mode="r") as zipfp:
610 with zipfile.ZipFile(TESTFN2, "w") as zipfp:
613 with zipfile.ZipFile(TESTFN2, "w", strict_timestamps=False) as zipfp:
642 with zipfile.ZipFile(TESTFN2, "w") as zipfp:
645 with zipfile.ZipFile(TESTFN2, "w", strict_timestamps=False) as zipfp:
659 with zipfile.ZipFile(TESTFN2, "w") as zipfp:
700 with zipfile.ZipFile(f, "w", compression, allowZip64=True) as zipfp:
706 with zipfile.ZipFile(f, "r", compression) as zipfp:
761 # and that the resulting archive can be read properly by ZipFile
762 zipf = zipfile.ZipFile(TESTFN, "w", self.compression,
771 zipf2 = zipfile.ZipFile(TESTFN, "r", self.compression)
779 zipf = zipfile.ZipFile(TESTFN, "w", self.compression,
791 zipf = zipfile.ZipFile(TESTFN, "a", self.compression,
800 zipf = zipfile.ZipFile(TESTFN, "a", self.compression,
810 zipf2 = zipfile.ZipFile(TESTFN, "r", self.compression)
829 with zipfile.ZipFile(f, "w", compression, allowZip64=False) as zipfp:
834 with zipfile.ZipFile(f, "w", compression, allowZip64=False) as zipfp:
844 with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED,
848 with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) as zipfp:
854 with zipfile.ZipFile(TESTFN2, "w", allowZip64=True) as zipfp:
856 with zipfile.ZipFile(TESTFN2, "r", allowZip64=True) as zipfp:
859 with zipfile.ZipFile(TESTFN2, "a", allowZip64=True) as zipfp:
861 with zipfile.ZipFile(TESTFN2, "r", allowZip64=True) as zipfp:
986 zipfile.ZipFile(io.BytesIO(missing_file_size_extra))
997 zipfile.ZipFile(io.BytesIO(missing_compress_size_extra))
1006 zipfile.ZipFile(io.BytesIO(missing_compress_size_extra))
1020 zipfile.ZipFile(io.BytesIO(missing_header_offset_extra))
1032 zipfile.ZipFile(io.BytesIO(missing_header_offset_extra))
1044 zipfile.ZipFile(io.BytesIO(missing_header_offset_extra))
1055 zipfile.ZipFile(io.BytesIO(missing_header_offset_extra))
1078 with zipfile.ZipFile(io.BytesIO(self.make_zip64_file(**kwargs))) as zf:
1107 with zipfile.ZipFile(data, mode="w", allowZip64=True) as zf:
1134 z = zipfile.ZipFile(io.BytesIO(zipdata))
1143 with zipfile.ZipFile(fp, mode="w", allowZip64=True) as zf:
1153 with zipfile.ZipFile(fp, mode="w", allowZip64=False) as zf:
1181 with zipfile.ZipFile(fp, mode="w", allowZip64=True) as zf:
1262 with zipfile.ZipFile(TESTFN2, "w", self.compression) as zipf:
1273 with zipfile.ZipFile(TESTFN2, "w", self.compression) as zipf:
1284 with zipfile.ZipFile(io.BytesIO(), 'w', self.compression) as zip:
1501 with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
1508 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
1526 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
1554 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
1566 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
1592 san = zipfile.ZipFile._sanitize_windows_name
1649 with zipfile.ZipFile(TESTFN2, 'w', zipfile.ZIP_STORED) as zipfp:
1660 with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
1668 with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
1675 with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
1682 with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
1693 with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
1699 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
1712 with zipfile.ZipFile(TESTFN2, 'w') as orig_zip:
1720 with zipfile.ZipFile(TESTFN2, "w") as zipfp:
1726 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
1733 with zipfile.ZipFile(TESTFN2, "w") as zipfp:
1738 with zipfile.ZipFile(TESTFN2, "r") as zipfp2:
1751 self.assertRaises(NotImplementedError, zipfile.ZipFile,
1758 with zipfile.ZipFile(fname) as zipfp:
1763 with zipfile.ZipFile(TESTFN, "w") as zf:
1768 with zipfile.ZipFile(TESTFN, "r") as zf:
1773 with zipfile.ZipFile(TESTFN2, 'w') as zipfp:
1782 with zipfile.ZipFile(TESTFN2, "x", zipfile.ZIP_STORED) as zipfp:
1785 zipfile.ZipFile(TESTFN2, "x", zipfile.ZIP_STORED)
1786 with zipfile.ZipFile(TESTFN2, "r") as zipfp:
1798 with zipfile.ZipFile(TESTFN, 'a') as zf:
1805 with zipfile.ZipFile(TESTFN, 'r') as zf:
1809 # This test checks that the ZipFile constructor closes the file object
1811 # traceback holds a reference to the ZipFile object and, indirectly,
1819 zf = zipfile.ZipFile(TESTFN)
1845 with zipfile.ZipFile(fp, mode="w") as zipf:
1853 self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, fp)
1858 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
1876 # ZipFile instance is finalized; this tests for regression on SF tracker
1880 # when a ZipFile instance was created for a file that did not
1886 self.assertRaises(OSError, zipfile.ZipFile, TESTFN)
1891 self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN)
1895 self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN)
1906 self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, f)
1911 with zipfile.ZipFile(data, mode="w") as zipf:
1914 # This is correct; calling .read on a closed ZipFile should raise
1927 """Check that bad modes passed to ZipFile constructor are caught."""
1928 self.assertRaises(ValueError, zipfile.ZipFile, TESTFN, "q")
1931 """Check that bad modes passed to ZipFile.open are caught."""
1932 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
1935 with zipfile.ZipFile(TESTFN, mode="r") as zipf:
1946 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
1958 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
1962 """Check that bad compression methods passed to ZipFile.open are
1964 self.assertRaises(NotImplementedError, zipfile.ZipFile, TESTFN, "w", -1)
1974 with zipfile.ZipFile(io.BytesIO(data), 'r') as zipf:
1980 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
1995 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
1999 with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
2004 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
2007 with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
2013 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
2017 with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
2021 with zipfile.ZipFile(TESTFN, mode="w") as zipf:
2025 with zipfile.ZipFile(TESTFN, mode="r") as zipfr:
2029 with zipfile.ZipFile(TESTFN,mode="w") as zipf:
2032 with zipfile.ZipFile(TESTFN,mode="a") as zipf:
2034 with zipfile.ZipFile(TESTFN,mode="r") as zipf:
2039 with zipfile.ZipFile(TESTFN,mode="w") as zipf:
2043 with zipfile.ZipFile(TESTFN,mode="a") as zipf:
2046 with zipfile.ZipFile(TESTFN,mode="r") as zipf:
2050 with zipfile.ZipFile(TESTFN, "w", zipfile.ZIP_STORED) as zipf:
2056 with zipfile.ZipFile(TESTFN, "a", zipfile.ZIP_STORED) as zipf:
2059 with zipfile.ZipFile(TESTFN, "r") as zipf:
2063 with zipfile.ZipFile(TESTFN, "w", zipfile.ZIP_STORED) as zipf:
2065 with zipfile.ZipFile(TESTFN, "a", zipfile.ZIP_STORED) as zipf:
2068 with zipfile.ZipFile(TESTFN, "r") as zipf:
2074 zipf = zipfile.ZipFile(TESTFN, mode="w")
2077 zipf = zipfile.ZipFile(TESTFN, mode="r")
2081 zipf = zipfile.ZipFile(TESTFN, mode="a")
2084 zipf = zipfile.ZipFile(TESTFN, mode="r")
2094 self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN, 'r')
2138 with zipfile.ZipFile(io.BytesIO(zipdata), 'r') as zipf:
2147 with zipfile.ZipFile(TESTFN2, 'w', zipfile.ZIP_STORED) as zipf:
2165 with zipfile.ZipFile(TESTFN2, 'r') as zipf:
2176 with zipfile.ZipFile(TESTFN, "w") as zipf:
2178 with zipfile.ZipFile(TESTFN, "r") as zipf:
2193 with zipfile.ZipFile(data, mode="w") as zipf:
2195 with zipfile.ZipFile(data, mode="r") as zipf:
2213 with zipfile.ZipFile(zip_file, 'w', compression=zipfile.ZIP_BZIP2) as zf:
2216 with zipfile.ZipFile(zip_file) as zf:
2234 with zipfile.ZipFile(io.BytesIO(data), 'r') as zipf:
2265 with zipfile.ZipFile(io.BytesIO(data), 'r') as zipf:
2289 with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
2297 # Using ZipFile.read()
2298 with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
2302 with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
2307 with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
2400 self.zip = zipfile.ZipFile(TESTFN, "r")
2403 self.zip2 = zipfile.ZipFile(TESTFN2, "r")
2505 with zipfile.ZipFile(f, "w", compression) as zipfp:
2513 with zipfile.ZipFile(f, "r", compression) as zipfp:
2527 with zipfile.ZipFile(f, "r", compression) as zipfp:
2560 with zipfile.ZipFile(f, "r", compression) as zipfp:
2632 with zipfile.ZipFile(wrapper(bf), 'w', zipfile.ZIP_STORED) as zipfp:
2636 with zipfile.ZipFile(f, mode='r') as zipf:
2648 with zipfile.ZipFile(wrapper(bf), 'w', zipfile.ZIP_STORED) as zipfp:
2657 with zipfile.ZipFile(f, mode='r') as zipf:
2669 with zipfile.ZipFile(wrapper(bf), 'w', zipfile.ZIP_STORED) as zipf:
2675 with zipfile.ZipFile(f) as zipf:
2689 with zipfile.ZipFile(f, "w", zipfile.ZIP_DEFLATED) as zipfp:
2694 # Verify that (when the ZipFile is in control of creating file objects)
2698 with zipfile.ZipFile(f, mode="r") as zipf:
2708 # Verify that (when the ZipFile is in control of creating file objects)
2712 with zipfile.ZipFile(f, mode="r") as zipf:
2722 # Verify that (when the ZipFile is in control of creating file objects)
2726 with zipfile.ZipFile(f, mode="r") as zipf:
2740 with zipfile.ZipFile(f, 'r') as zipf:
2752 with zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED) as zipf:
2758 with zipfile.ZipFile(f, 'r') as zipf:
2766 with zipfile.ZipFile(f, "w", zipfile.ZIP_DEFLATED) as zipf:
2771 with zipfile.ZipFile(f, 'r') as zipf:
2782 with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
2790 with zipfile.ZipFile(TESTFN2, 'w', zipfile.ZIP_DEFLATED) as zipf:
2792 with zipfile.ZipFile(TESTFN2, 'a', zipfile.ZIP_DEFLATED) as zipf:
2799 with zipfile.ZipFile(TESTFN2) as zipf:
2811 with zipfile.ZipFile(findfile("zipdir.zip")) as zipf:
2826 with zipfile.ZipFile(TESTFN, "w") as zipf:
2835 with zipfile.ZipFile(TESTFN, "r") as zipf:
2850 with zipfile.ZipFile(TESTFN, "w") as zipf:
2855 with zipfile.ZipFile(TESTFN, "r") as zipf:
2866 with zipfile.ZipFile(TESTFN, "w") as zf:
2898 with zipfile.ZipFile(TESTFN, "w") as zf:
2991 with zipfile.ZipFile(zip_name, 'r') as tf:
3014 with zipfile.ZipFile(TESTFN2) as zf:
3027 with zipfile.ZipFile(zip_name) as zf:
3050 # Ensure we can operate on these via ZipFile.
3051 with zipfile.ZipFile(name) as zipfp:
3136 zf = zipfile.ZipFile(data, "w")
3229 zf = zipfile.ZipFile(in_memory_file, "w")
3244 zf = zipfile.ZipFile(in_memory_file, "w")
3271 with zipfile.ZipFile(io.BytesIO(), "w") as zf:
3291 zf = zipfile.Path(zipfile.ZipFile(io.BytesIO(), mode='w'))
3415 zf = zipfile.ZipFile(strm, "w")
3440 with zipfile.ZipFile(alpharep) as file:
3561 zf = zipfile.ZipFile(source_path)
3571 zf = zipfile.ZipFile(data, "w")
3602 with zipfile.ZipFile(TESTFN, mode="w") as tf:
3633 with zipfile.ZipFile(TESTFN, "r", metadata_encoding='shift_jis') as zipfp:
3640 with zipfile.ZipFile(TESTFN, "r") as zipfp:
3647 with zipfile.ZipFile(TESTFN, "r", metadata_encoding='koi8-u') as zipfp:
3654 zipfile.ZipFile(TESTFN, "r", metadata_encoding='ascii')
3656 zipfile.ZipFile(TESTFN, "r", metadata_encoding='utf-8')
3665 with zipfile.ZipFile(TESTFN, "a") as zipfp:
3669 with zipfile.ZipFile(TESTFN, "r") as zipfp:
3672 with zipfile.ZipFile(TESTFN, "r", metadata_encoding='shift_jis') as zipfp:
3685 ZF = zipfile.ZipFile