summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-06-25 14:56:31 (GMT)
committerGitHub <noreply@github.com>2020-06-25 14:56:31 (GMT)
commit700cfa8c90a90016638bac13c4efd03786b2b2a0 (patch)
tree62994f7b8d6fccd910d5f65bd6cd49a4f72bf8ae /Lib/test/test_tarfile.py
parent8ea6353f60625c96ce96588c70ff24a77f8c71f9 (diff)
downloadcpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.zip
cpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.tar.gz
cpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.tar.bz2
bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035)
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index be66f1f..d60d35b 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -2305,7 +2305,8 @@ class CommandLineTest(unittest.TestCase):
def test_test_command_verbose(self):
for tar_name in testtarnames:
for opt in '-v', '--verbose':
- out = self.tarfilecmd(opt, '-t', tar_name)
+ out = self.tarfilecmd(opt, '-t', tar_name,
+ PYTHONIOENCODING='utf-8')
self.assertIn(b'is a tar archive.\n', out)
def test_test_command_invalid_file(self):
@@ -2376,7 +2377,8 @@ class CommandLineTest(unittest.TestCase):
'and-utf8-bom-sig-only.txt')]
for opt in '-v', '--verbose':
try:
- out = self.tarfilecmd(opt, '-c', tmpname, *files)
+ out = self.tarfilecmd(opt, '-c', tmpname, *files,
+ PYTHONIOENCODING='utf-8')
self.assertIn(b' file created.', out)
with tarfile.open(tmpname) as tar:
tar.getmembers()
@@ -2434,7 +2436,8 @@ class CommandLineTest(unittest.TestCase):
for opt in '-v', '--verbose':
try:
with support.temp_cwd(tarextdir):
- out = self.tarfilecmd(opt, '-e', tmpname)
+ out = self.tarfilecmd(opt, '-e', tmpname,
+ PYTHONIOENCODING='utf-8')
self.assertIn(b' file is extracted.', out)
finally:
support.rmtree(tarextdir)