Commit ab58b5f9 authored by Antoine Pitrou's avatar Antoine Pitrou

Try harder to fix test_tarfile under Windows buildbots

parent 95f5560b
...@@ -25,7 +25,7 @@ except ImportError: ...@@ -25,7 +25,7 @@ except ImportError:
def md5sum(data): def md5sum(data):
return md5(data).hexdigest() return md5(data).hexdigest()
TEMPDIR = os.path.abspath(support.TESTFN) TEMPDIR = os.path.abspath(support.TESTFN) + "-tardir"
tarname = support.findfile("testtar.tar") tarname = support.findfile("testtar.tar")
gzipname = os.path.join(TEMPDIR, "testtar.tar.gz") gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2") bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
...@@ -538,6 +538,7 @@ class MemberReadTest(ReadTest): ...@@ -538,6 +538,7 @@ class MemberReadTest(ReadTest):
self._test_member(tarinfo, size=7011, chksum=md5_regtype) self._test_member(tarinfo, size=7011, chksum=md5_regtype)
def test_find_pax_umlauts(self): def test_find_pax_umlauts(self):
self.tar.close()
self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1") self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1")
tarinfo = self.tar.getmember("pax/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf") tarinfo = self.tar.getmember("pax/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
self._test_member(tarinfo, size=7011, chksum=md5_regtype) self._test_member(tarinfo, size=7011, chksum=md5_regtype)
...@@ -1228,6 +1229,7 @@ class UstarUnicodeTest(unittest.TestCase): ...@@ -1228,6 +1229,7 @@ class UstarUnicodeTest(unittest.TestCase):
self.assertEqual(t.gname, "\xe4\xf6\xfc") self.assertEqual(t.gname, "\xe4\xf6\xfc")
if self.format != tarfile.PAX_FORMAT: if self.format != tarfile.PAX_FORMAT:
tar.close()
tar = tarfile.open(tmpname, encoding="ascii") tar = tarfile.open(tmpname, encoding="ascii")
t = tar.getmember("foo") t = tar.getmember("foo")
self.assertEqual(t.uname, "\udce4\udcf6\udcfc") self.assertEqual(t.uname, "\udce4\udcf6\udcfc")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment