Issue #24838: Fix test_tarfile.py for non-utf8 filesystem encodings.

This commit is contained in:
Lars Gustäbel 2016-04-19 11:58:41 +02:00
parent 0f450abec4
commit ddd9917ac3
1 changed files with 2 additions and 2 deletions

View File

@ -1795,7 +1795,7 @@ class UstarUnicodeTest(UnicodeTest, unittest.TestCase):
self.assertRaises(exc, tar.addfile, t)
if exc is None:
with tarfile.open(tmpname, "r") as tar:
with tarfile.open(tmpname, "r", encoding="utf-8") as tar:
for t in tar:
self.assertEqual(name, t.name)
break
@ -1821,7 +1821,7 @@ class UstarUnicodeTest(UnicodeTest, unittest.TestCase):
self.assertRaises(exc, tar.addfile, t)
if exc is None:
with tarfile.open(tmpname, "r") as tar:
with tarfile.open(tmpname, "r", encoding="utf-8") as tar:
for t in tar:
self.assertEqual(name, t.linkname)
break