Home | History | Annotate | Download | only in test

Lines Matching full:open

45         self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1")
63 fobj1 = open(os.path.join(TEMPDIR, "ustar/regtype"), "rU")
79 fobj1 = open(os.path.join(TEMPDIR, "ustar/regtype"), "rU")
88 fobj = open(os.path.join(TEMPDIR, "ustar/regtype"), "rb")
165 # This test checks if tarfile.open() is able to open an empty tar
168 tarfile.open(tmpname, self.mode.replace("r", "w")).close()
170 tar = tarfile.open(tmpname, self.mode)
173 self.fail("tarfile.open() failed on empty archive")
178 # This test guarantees that tarfile.open() does not treat an empty
180 open(tmpname, "wb").close()
181 self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, self.mode)
182 self.assertRaises(tarfile.ReadError, tarfile.open, tmpname)
191 _open = open
201 tar = tarfile.open(tmpname, mode="r", ignore_zeros=True)
210 fobj = open(self.tarname, "rb")
211 tar = tarfile.open(fileobj=fobj, mode=self.mode)
215 data = open(self.tarname, "rb").read()
218 tar = tarfile.open(fileobj=fobj, mode=self.mode)
222 data = open(self.tarname, "rb").read()
225 tar = tarfile.open(fileobj=fobj, mode=self.mode)
231 tar = tarfile.open(self.tarname, mode=self.mode)
239 # Open the testtar and seek to the offset of the second member.
245 _open = open
250 tar = tar.open(self.tarname, mode="r:", fileobj=fobj)
264 self.assertRaises(tarfile.ReadError, tarfile.open, tarname, self.mode)
265 fobj = open(tarname, "rb")
266 self.assertRaises(tarfile.ReadError, tarfile.open, fileobj=fobj, mode=self.mode)
300 with tarfile.open(tarname, errorlevel=1, encoding="iso8859-1") as tar:
306 with open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb") as f:
312 with open(os.path.join(TEMPDIR, "ustar/symtype"), "rb") as f:
319 tar = tarfile.open(tarname, encoding="iso8859-1")
335 open(empty, "wb").write("")
351 with tarfile.open(self.tarname) as tar:
374 tar1 = tarfile.open(tarname, encoding="iso8859-1")
402 tarfile.open(name, mode)
408 tarfile.open(name, mode, fileobj=open(name, "rb"))
420 self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r:gz")
421 self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r|gz")
422 self.assertRaises(tarfile.ReadError, tarfile.open, gzipname, mode="r:")
423 self.assertRaises(tarfile.ReadError, tarfile.open, gzipname, mode="r|")
432 self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r:bz2")
433 self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r|bz2")
434 self.assertRaises(tarfile.ReadError, tarfile.open, bz2name, mode="r:")
435 self.assertRaises(tarfile.ReadError, tarfile.open, bz2name, mode="r|")
457 with open(tarname, "rb") as fobj:
538 self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1")
569 self.assertRaises(tarfile.ReadError, tarfile.open, name="foo.tar", fileobj=fobj)
576 fobj = open(tarname)
602 tar = tarfile.open(tarname, encoding="iso8859-1")
621 tar = tarfile.open(tarname, encoding="iso8859-1")
638 tar = tarfile.open(fileobj=fobj, mode=self.mode)
654 tar = tarfile.open(tmpname, self.mode)
659 tar = tarfile.open(tmpname)
666 tar = tarfile.open(tmpname, self.mode)
668 fobj = open(path, "wb")
678 tar = tarfile.open(tmpname, self.mode)
681 fobj = open(path, "wb")
686 fobj = open(path, "wb")
698 tar = tarfile.open(tmpname, self.mode)
708 fobj = open(target, "wb")
713 tar = tarfile.open(tmpname, self.mode)
727 tar = tarfile.open(tmpname, self.mode)
737 tar = tarfile.open(tmpname, self.mode)
755 open(name, "wb").close()
759 tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
765 tar = tarfile.open(tmpname, "r")
777 open(name, "wb").close()
786 tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
790 tar = tarfile.open(tmpname, "r")
808 open(foo, "w").close()
812 tar = tarfile.open(tmpname, self.mode)
816 tar = tarfile.open(tmpname, "r")
856 open("foo", "w").close()
858 tar = tarfile.open(tmpname, self.mode)
862 tar = tarfile.open(tmpname, "r")
878 with open(source_file,'w') as f:
881 tar = tarfile.open(temparchive,'w')
886 tar = tarfile.open(temparchive,'r')
908 with open(source_file,'w') as f:
911 tar = tarfile.open(temparchive,'w')
917 tar = tarfile.open(temparchive,'r')
938 with open(source_file,'w') as f:
941 tar = tarfile.open(temparchive,'w')
946 tar = tarfile.open(temparchive,'r')
964 tar = tarfile.open(tmpname, self.mode)
973 data = open(tmpname, "rb").read()
978 fobj = open(tmpname, "rb")
996 tar = tarfile.open(tmpname, self.mode)
1005 with tarfile.open(unicode(tmpname, sys.getfilesystemencoding()), self.mode):
1041 tar = tarfile.open(tmpname, "w")
1051 tar = tarfile.open(tmpname)
1098 fobj = open(self.foo, "wb")
1104 self.tar = tarfile.open(tmpname, "w")
1140 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT)
1144 tar = tarfile.open(tmpname)
1160 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT,
1166 tar = tarfile.open(tmpname, encoding="iso8859-1")
1185 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT, encoding="iso8859-1")
1193 tar = tarfile.open(tmpname, encoding="iso8859-1")
1215 tar = tarfile.open(tmpname, "w", format=self.format, encoding=encoding, errors="strict")
1220 tar = tarfile.open(tmpname, encoding=encoding)
1226 tar = tarfile.open(tmpname, "w", format=self.format, encoding="ascii", errors="strict")
1243 tar = tarfile.open(tarname, "r", encoding="iso8859-1", errors="strict")
1258 tar = tarfile.open("foo.tar", mode="w", fileobj=fobj, format=self.format, encoding="iso8859-1")
1263 tar = tarfile.open("foo.tar", fileobj=fobj, encoding="iso8859-1")
1279 tar = tarfile.open(tmpname, "w", format=self.format)
1292 tar = tarfile.open(tmpname, format=self.format, encoding="ascii",
1296 self.assertRaises(UnicodeError, tarfile.open, tmpname,
1304 tar = tarfile.open(tmpname, format=self.format, encoding="iso8859-1",
1318 tar = tarfile.open(self.tarname, "a", fileobj=fileobj)
1323 src = tarfile.open(tarname, encoding="iso8859-1")
1327 tar = tarfile.open(self.tarname, mode)
1332 tar = tarfile.open(self.tarname, fileobj=fileobj)
1340 tarfile.open(self.tarname, "w:").close()
1352 data = open(self.tarname).read()
1367 self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, "a")
1373 self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, "a")
1378 open(self.tarname, "wb").write(data)
1461 with tarfile.open(tarname) as tar:
1468 tar = tarfile.open(tarname)
1477 with tarfile.open(tarname) as tar:
1487 with tarfile.open(tmpname, "w") as tar:
1498 with tarfile.open(tmpname, "w"):
1506 fobj = open(tmpname, "wb")
1508 with tarfile.open(fileobj=fobj, mode="w") as tar:
1524 data = open(os.path.join(TEMPDIR, name), "rb").read()
1578 raise AssertionError("infinite loop detected in tarfile.open()")
1588 tarfile.open(fileobj=MyStringIO(data[:x]), mode=mode)
1627 fobj = open(tarname, "rb")
1633 tar = gzip.open(gzipname, "wb")