diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-06-25 14:56:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 14:56:31 (GMT) |
commit | 700cfa8c90a90016638bac13c4efd03786b2b2a0 (patch) | |
tree | 62994f7b8d6fccd910d5f65bd6cd49a4f72bf8ae /Lib/test/test_fstring.py | |
parent | 8ea6353f60625c96ce96588c70ff24a77f8c71f9 (diff) | |
download | cpython-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_fstring.py')
-rw-r--r-- | Lib/test/test_fstring.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 9eb7ebe..7ffe01d 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -1055,8 +1055,9 @@ non-important content file_path = os.path.join(cwd, 't.py') with open(file_path, 'w') as f: f.write('f"{a b}"') # This generates a SyntaxError - _, _, stderr = assert_python_failure(file_path) - self.assertIn(file_path, stderr.decode('utf-8')) + _, _, stderr = assert_python_failure(file_path, + PYTHONIOENCODING='ascii') + self.assertIn(file_path.encode('ascii', 'backslashreplace'), stderr) def test_loop(self): for i in range(1000): |