summaryrefslogtreecommitdiff
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorLars Gust?bel <lars@gustaebel.de>2016-04-19 11:58:41 +0200
committerLars Gust?bel <lars@gustaebel.de>2016-04-19 11:58:41 +0200
commitf77007da64fa08032e9fb10259cb97990b1eec3a (patch)
treef6b4180d92c47b5c06345a9a3dc655927fcce642 /Lib/test/test_tarfile.py
parent74b13e256410d1fe4d29f7f29919abf1027e13d3 (diff)
downloadcpython-f77007da64fa08032e9fb10259cb97990b1eec3a.tar.gz
Issue #24838: Fix test_tarfile.py for non-utf8 filesystem encodings.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index c039f5aa75..abfb34dfb8 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -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