summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httpservers.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r--Lib/test/test_httpservers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index c3d7c8f..12574a6 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -541,7 +541,7 @@ class SimpleHTTPServerTestCase(BaseTestCase):
fullpath = os.path.join(self.tempdir, filename)
try:
- open(fullpath, 'w').close()
+ open(fullpath, 'wb').close()
except OSError:
raise unittest.SkipTest('Can not create file %s on current file '
'system' % filename)
@@ -646,7 +646,7 @@ class CGIHTTPServerTestCase(BaseTestCase):
self.skipTest("Python executable path is not encodable to utf-8")
self.nocgi_path = os.path.join(self.parent_dir, 'nocgi.py')
- with open(self.nocgi_path, 'w') as fp:
+ with open(self.nocgi_path, 'w', encoding='utf-8') as fp:
fp.write(cgi_file1 % self.pythonexe)
os.chmod(self.nocgi_path, 0o777)