Lines Matching refs:open
63 open = io.FileIO
74 open = gzip.GzipFile if gzip else None
81 open = bz2.BZ2File if bz2 else None
88 open = lzma.LZMAFile if lzma else None
97 self.tar = tarfile.open(self.tarname, mode=self.mode,
118 with open(os.path.join(TEMPDIR, "ustar/regtype"), "r") as fobj1:
136 with open(os.path.join(TEMPDIR, "ustar/regtype"), "r") as fobj1:
146 with open(os.path.join(TEMPDIR, "ustar/regtype"), "rb") as fobj:
242 with tarfile.open(tmpname, 'w') as tar:
249 with tarfile.open(tmpname) as tar:
269 self.tar = tarfile.open(self.tarname, mode=self.mode)
360 with open(tmpname, "wb"):
370 with open(tmpname, "rb") as fobj:
384 with open(self.tarname, "rb") as fobj:
388 with open(self.tarname, "rb") as fobj:
394 with open(self.tarname, "rb") as fobj:
398 with open(self.tarname, "rb") as fobj:
405 # This test checks if tarfile.open() is able to open an empty tar
408 with tarfile.open(tmpname, self.mode.replace("r", "w")):
411 tar = tarfile.open(tmpname, self.mode)
414 self.fail("tarfile.open() failed on empty archive")
424 tarfile.open("xxx", self.mode)
428 # This test guarantees that tarfile.open() does not treat an empty
430 with open(tmpname, "wb"):
432 self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, self.mode)
433 self.assertRaises(tarfile.ReadError, tarfile.open, tmpname)
442 with self.open(tmpname, "w") as fobj:
449 tar = tarfile.open(tmpname, mode="r", ignore_zeros=True)
459 with tarfile.open(tmpname, "w:") as tar:
464 with open(tmpname, "r+b") as fobj:
467 with tarfile.open(tmpname) as tar:
472 with tarfile.open(tmpname) as tar:
485 with tarfile.open(support.findfile('recursion.tar')) as tar:
494 with open(self.tarname, "rb") as fobj:
496 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
501 with open(self.tarname, "rb") as fobj:
505 tar = tarfile.open(fileobj=fobj, mode=self.mode)
509 with open(self.tarname, "rb") as fobj:
513 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
517 # Issue 21044: tarfile.open() should handle fileobj with an integer
519 fd = os.open(self.tarname, os.O_RDONLY)
520 with open(fd, 'rb') as fobj:
522 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
528 with open(tarname, 'rb') as fobj:
530 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
536 with tarfile.open(tarname, mode=self.mode) as tar:
542 with tarfile.TarFile.open(tarname, mode=self.mode) as tar:
551 with open(tmpname, 'wb'):
563 tar = tarfile.open(self.tarname, mode=self.mode)
575 with self.open(self.tarname) as fobj:
579 with tar.open(self.tarname, mode="r:", fileobj=fobj) as tar:
590 self.assertRaises(tarfile.ReadError, tarfile.open, tarname, self.mode)
591 with open(tarname, "rb") as fobj:
592 self.assertRaises(tarfile.ReadError, tarfile.open,
630 with tarfile.open(tarname, errorlevel=1, encoding="iso8859-1") as tar:
636 with open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb") as f:
642 with open(os.path.join(TEMPDIR, "ustar/symtype"), "rb") as f:
650 tar = tarfile.open(tarname, encoding="iso8859-1")
684 with tarfile.open(tarname, encoding="iso8859-1") as tar:
697 tarfile.open(tarname, encoding="iso8859-1") as tar:
708 tarfile.open(tarname, encoding="iso8859-1") as tar:
719 with open(empty, "wb") as fobj:
736 with tarfile.open(self.tarname) as tar:
743 # bpo-39039: tarfile.open allowed zlib exceptions to bubble up when
748 tarfile.open(self.tarname)
752 tf = tarfile.open(fileobj=fd, mode="w")
756 with tarfile.open(fileobj=fd, mode="r|") as tf:
760 with tarfile.open(fileobj=fd, mode="r") as tf:
813 tar1 = tarfile.open(tarname, encoding="iso8859-1")
852 tar = tarfile.open(name, mode)
860 with open(name, "rb") as f:
861 tar = tarfile.open(name, mode, fileobj=f)
870 tarfile.open(tarname, mode="r:" + self.suffix)
872 tarfile.open(tarname, mode="r|" + self.suffix)
874 tarfile.open(self.tarname, mode="r:")
876 tarfile.open(self.tarname, mode="r|")
898 with open(tarname, "rb") as fobj:
1001 self.tar = tarfile.open(self.tarname, mode=self.mode,
1036 tarfile.open(name="foo.tar", fileobj=fobj)
1043 with open(tarname, "rb") as fobj:
1053 with tarfile.open(tmpname, 'w') as tar:
1060 with tarfile.open(tmpname) as tar:
1080 with open(filename, "rb") as fobj:
1112 with open(name, "wb") as fobj:
1131 tar = tarfile.open(tarname, encoding="iso8859-1")
1155 tar = tarfile.open(tarname, encoding="iso8859-1")
1187 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT,
1198 with open(tmpname, "rb") as f:
1203 with open(tmpname, "wb") as f:
1208 tarfile.open(tmpname, encoding="iso8859-1")
1217 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
1232 with tarfile.open(tmpname, self.mode) as tar:
1237 with self.open(tmpname, "rb") as fobj:
1251 tar = tarfile.open(tmpname, self.mode)
1258 tar = tarfile.open(tmpname)
1267 tar = tarfile.open(tmpname, self.mode)
1270 with open(path, "wb") as fobj:
1280 tar = tarfile.open(tmpname, self.mode)
1283 with open(path, "wb"):
1288 with open(path, "wb") as fobj:
1299 tar = tarfile.open(tmpname, self.mode)
1313 open(os.path.join(path, "1"), "a").close()
1314 open(os.path.join(path, "2"), "a").close()
1316 tar = tarfile.open(tmpname, self.mode)
1333 with tarfile.open(tmpname, self.mode) as tar:
1335 with open(path, "wb") as fobj:
1348 with open(target, "wb") as fobj:
1355 tar = tarfile.open(tmpname, self.mode)
1372 tar = tarfile.open(tmpname, self.mode)
1384 tar = tarfile.open(tmpname, self.mode)
1414 tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
1424 tar = tarfile.open(tmpname, "r")
1448 tar = tarfile.open(tmpname, self.mode)
1454 tar = tarfile.open(tmpname, "r")
1477 with open(source_file,'w') as f:
1480 with tarfile.open(temparchive, 'w') as tar:
1484 with tarfile.open(temparchive, errorlevel=2) as tar:
1522 tar = tarfile.open(tmpname, self.mode)
1528 tar = tarfile.open(tmpname, "r")
1547 tar = tarfile.open(tmpname, self.mode, fileobj=f,
1572 tar = tarfile.open(tmpname, self.mode)
1576 with open(tmpname, "rb") as fobj:
1581 with self.open(tmpname) as fobj:
1600 tar = tarfile.open(tmpname, self.mode)
1614 tarfile.open(tmpname, self.mode).close()
1654 tar = tarfile.open(tmpname, "w")
1665 tar = tarfile.open(tmpname)
1717 tar = tarfile.open(tmpname, self.mode)
1729 tar = tarfile.open(tmpname, "r")
1741 with open(tmpname, "rb") as infile:
1765 with open(cls.file_path, "wb") as fobj:
1773 with tarfile.open(tmpname, self.mode) as tobj:
1782 with tarfile.open(tmpname, self.mode) as tobj:
1786 tobj = tarfile.open(tmpname, self.mode)
1816 with tarfile.open(pathlib.Path(tmpname), self.mode) as tobj:
1847 with tarfile.open(tmpname, self.mode, compresslevel=1) as tobj:
1849 with tarfile.open(tmpname, 'r:gz', compresslevel=1) as tobj:
1856 with tarfile.open(tmpname, self.mode, compresslevel=1) as tobj:
1858 with tarfile.open(tmpname, 'r:bz2', compresslevel=1) as tobj:
1867 with tarfile.open(tmpname, self.mode, preset=1) as tobj:
1887 with open(self.foo, "wb") as fobj:
1895 self.tar = tarfile.open(tmpname, "w")
1931 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT)
1937 tar = tarfile.open(tmpname)
1956 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT,
1964 tar = tarfile.open(tmpname, encoding="iso8859-1")
1985 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT,
1996 tar = tarfile.open(tmpname, encoding="iso8859-1")
2073 tar = tarfile.open(tmpname, "w", format=self.format,
2081 tar = tarfile.open(tmpname, encoding=encoding)
2088 tar = tarfile.open(tmpname, "w", format=self.format,
2103 tar = tarfile.open(tarname, "r",
2119 tar = tarfile.open(tmpname, mode="w", format=self.format,
2126 tar = tarfile.open(tmpname, encoding="iso8859-1")
2134 tar = tarfile.open(tmpname, encoding="ascii")
2181 with tarfile.open(tmpname, "w", format=self.format, encoding="utf-8") as tar:
2189 with tarfile.open(tmpname, "r", encoding="utf-8") as tar:
2206 with tarfile.open(tmpname, "w", format=self.format, encoding="utf-8") as tar:
2215 with tarfile.open(tmpname, "r", encoding="utf-8") as tar:
2231 with tarfile.open(tarname, encoding=encoding,
2251 with tarfile.open(tarname, encoding=encoding,
2268 with tarfile.open(tarname, encoding="iso8859-1") as src:
2272 with tarfile.open(self.tarname, mode) as tar:
2277 self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, "a")
2283 with tarfile.open(self.tarname, "a", fileobj=fileobj) as tar:
2287 with tarfile.open(self.tarname, fileobj=fileobj) as tar:
2295 tarfile.open(self.tarname, "w:").close()
2307 with open(self.tarname, "rb") as fobj:
2322 with open(self.tarname, "wb") as fobj:
2502 tarfile.open(fname)
2525 with tarfile.open(tar_name, 'w') as tf:
2532 with tarfile.open(tar_name, 'w') as tf:
2570 with open(tar_name, 'rb') as f:
2573 with open(tmpname, 'wb') as f:
2584 with tarfile.open(tar_name, 'r') as tf:
2595 with tarfile.open(tar_name, 'r') as tf:
2618 with tarfile.open(tmpname) as tar:
2632 with tarfile.open(tmpname) as tar:
2642 with tarfile.open(dotlessname) as tar:
2653 with tarfile.open(tar_name) as tar:
2663 if not filetype.open:
2734 with tarfile.open(tarname) as tar:
2741 tar = tarfile.open(tarname)
2750 with tarfile.open(tarname) as tar:
2760 with tarfile.open(tmpname, "w") as tar:
2771 with tarfile.open(tmpname, "w"):
2779 with open(tmpname, "wb") as fobj:
2781 with tarfile.open(fileobj=fobj, mode="w") as tar:
2797 with open(os.path.join(TEMPDIR, name), "rb") as f:
2833 "tarfile.open()")
2843 tarfile.open(fileobj=MyBytesIO(data[:x]), mode=mode)
2886 with tarfile.open(tmpname, 'w') as tarfl:
2916 # open the tarfile for reading. yield it and the names of the items
2918 with tarfile.open(tar_filename) as tarfl:
3041 tar = tarfile.open(tarname, mode='r', encoding="iso8859-1")
3145 tar = tarfile.open(fileobj=bio, mode='w', format=tarformat)
3174 tarfile.open(tarname, encoding="iso8859-1") as tar):
3268 with t.open() as tar:
3306 def open(self, **kwargs):
3309 return tarfile.open(fileobj=bio, **kwargs)
3405 with self.check_context(arc.open(), filter):
3414 with self.check_context(arc.open(), 'fully_trusted'):
3418 with self.check_context(arc.open(), filter):
3443 with self.check_context(arc.open(), 'fully_trusted'):
3456 with self.check_context(arc.open(), 'tar'):
3462 with self.check_context(arc.open(), 'data'):
3470 with self.check_context(arc.open(), 'fully_trusted'):
3472 with self.check_context(arc.open(), 'tar'):
3474 with self.check_context(arc.open(), 'data'):
3486 with self.check_context(arc.open(), 'fully_trusted'):
3495 with self.check_context(arc.open(), 'tar'):
3506 with self.check_context(arc.open(), 'data'):
3520 with self.check_context(arc.open(), 'fully_trusted'):
3527 with self.check_context(arc.open(), 'tar'):
3537 with self.check_context(arc.open(), 'data'):
3549 with self.check_context(arc.open(), filter='fully_trusted'):
3569 with self.check_context(arc.open(), filter):
3583 with self.check_context(arc.open(), 'fully_trusted'):
3589 with self.check_context(arc.open(), filter):
3610 with open(tmp_filename, 'w'):
3621 with self.check_context(arc.open(), 'fully_trusted'):
3635 with self.check_context(arc.open(), 'tar'):
3643 with self.check_context(arc.open(), 'data'):
3659 with self.check_context(arc.open(), filter):
3666 with self.check_context(arc.open(), 'data'):
3688 with tarfile.TarFile.open(tarname) as tar:
3697 with tarfile.TarFile.open(tarname) as tar:
3706 with tarfile.TarFile.open(tarname) as tar:
3720 with self.check_context(arc.open(), None):
3777 with self.check_context(arc.open(), custom_filter):
3784 with self.check_context(arc.open(), 'bad filter name'):
3812 with self.check_context(arc.open(), custom_filter):
3834 with self.check_context(arc.open(errorlevel=0), extracterror_filter):
3837 with self.check_context(arc.open(errorlevel=0), filtererror_filter):
3840 with self.check_context(arc.open(errorlevel=0), oserror_filter):
3843 with self.check_context(arc.open(errorlevel=0), tarerror_filter):
3846 with self.check_context(arc.open(errorlevel=0), valueerror_filter):
3851 with self.check_context(arc.open(errorlevel=1), extracterror_filter):
3854 with self.check_context(arc.open(errorlevel=1), filtererror_filter):
3857 with self.check_context(arc.open(errorlevel=1), oserror_filter):
3860 with self.check_context(arc.open(errorlevel=1), tarerror_filter):
3863 with self.check_context(arc.open(errorlevel=1), valueerror_filter):
3868 with self.check_context(arc.open(errorlevel=2), extracterror_filter):
3871 with self.check_context(arc.open(errorlevel=2), filtererror_filter):
3874 with self.check_context(arc.open(errorlevel=2), oserror_filter):
3877 with self.check_context(arc.open(errorlevel=2), tarerror_filter):
3880 with self.check_context(arc.open(errorlevel=2), valueerror_filter):
3885 with self.check_context(arc.open(errorlevel='boo!'), filtererror_filter):
3895 with open(tarname, "rb") as fobj:
3900 if c.open:
3903 with c.open(c.tarname, "wb") as tar: