[Python-checkins] r85663 - python/branches/py3k/Lib/test/test_httpservers.py
victor.stinner
python-checkins at python.org
Sun Oct 17 22:17:41 CEST 2010
Author: victor.stinner
Date: Sun Oct 17 22:17:41 2010
New Revision: 85663
Log:
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 :-)
Modified:
python/branches/py3k/Lib/test/test_httpservers.py
Modified: python/branches/py3k/Lib/test/test_httpservers.py
==============================================================================
--- python/branches/py3k/Lib/test/test_httpservers.py (original)
+++ python/branches/py3k/Lib/test/test_httpservers.py Sun Oct 17 22:17:41 2010
@@ -321,12 +321,12 @@
"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)
More information about the Python-checkins
mailing list