diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-17 20:17:41 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-17 20:17:41 (GMT) |
commit | 6fb457526cef485d64f4f6744d81cae8c02032b3 (patch) | |
tree | d0ba8c48dce3e388f0827446dac322434ee5e8f1 /Lib/test/test_httpservers.py | |
parent | 3218c31429dfa88c6c4ab0980c1cf7a45bfa423e (diff) | |
download | cpython-6fb457526cef485d64f4f6744d81cae8c02032b3.zip cpython-6fb457526cef485d64f4f6744d81cae8c02032b3.tar.gz cpython-6fb457526cef485d64f4f6744d81cae8c02032b3.tar.bz2 |
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 :-)
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r-- | Lib/test/test_httpservers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 1aeee29..fa1fc59 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -321,12 +321,12 @@ class CGIHTTPServerTestCase(BaseTestCase): "Python executable path is not encodable to utf-8") self.file1_path = os.path.join(self.cgi_dir, 'file1.py') - with open(self.file1_path, 'w') as file1: + with open(self.file1_path, 'w', encoding='utf-8') as file1: file1.write(cgi_file1 % self.pythonexe) os.chmod(self.file1_path, 0o777) self.file2_path = os.path.join(self.cgi_dir, 'file2.py') - with open(self.file2_path, 'w') as file2: + with open(self.file2_path, 'w', encoding='utf-8') as file2: file2.write(cgi_file2 % self.pythonexe) os.chmod(self.file2_path, 0o777) |