Skip to content

Commit 6fb4575

Browse files
author
Victor Stinner
committed
test_httpservers: Python CGI scripts have to be encoded to utf-8
And not the locale encoding. With this commit, the test finally pass on Windows with a non-ascii path :-)
1 parent 3218c31 commit 6fb4575

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_httpservers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,12 @@ def setUp(self):
321321
"Python executable path is not encodable to utf-8")
322322

323323
self.file1_path = os.path.join(self.cgi_dir, 'file1.py')
324-
with open(self.file1_path, 'w') as file1:
324+
with open(self.file1_path, 'w', encoding='utf-8') as file1:
325325
file1.write(cgi_file1 % self.pythonexe)
326326
os.chmod(self.file1_path, 0o777)
327327

328328
self.file2_path = os.path.join(self.cgi_dir, 'file2.py')
329-
with open(self.file2_path, 'w') as file2:
329+
with open(self.file2_path, 'w', encoding='utf-8') as file2:
330330
file2.write(cgi_file2 % self.pythonexe)
331331
os.chmod(self.file2_path, 0o777)
332332

0 commit comments

Comments
 (0)