mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
[3.9] bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035). (GH-21156)
(cherry picked from commit 700cfa8c90
)
This commit is contained in:
parent
ad7a66731f
commit
f925407a19
23 changed files with 108 additions and 76 deletions
|
@ -1061,8 +1061,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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue