diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2016-04-19 09:58:41 (GMT) |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2016-04-19 09:58:41 (GMT) |
commit | ddd9917ac3f45a1bab9a200a6fe60a3407d1780d (patch) | |
tree | 88fe7d0e7973caf4ca3033bdcfba9e1c8b38cb2e | |
parent | 0f450abec432763b92d6a9b1a778e8c0e5232338 (diff) | |
download | cpython-ddd9917ac3f45a1bab9a200a6fe60a3407d1780d.zip cpython-ddd9917ac3f45a1bab9a200a6fe60a3407d1780d.tar.gz cpython-ddd9917ac3f45a1bab9a200a6fe60a3407d1780d.tar.bz2 |
Issue #24838: Fix test_tarfile.py for non-utf8 filesystem encodings.
-rw-r--r-- | Lib/test/test_tarfile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index c039f5a..abfb34d 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 |