]> granicus.if.org Git - python/commitdiff
Merged revisions 78500 via svnmerge from
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 27 Feb 2010 16:17:11 +0000 (16:17 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 27 Feb 2010 16:17:11 +0000 (16:17 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r78500 | florent.xicluna | 2010-02-27 17:12:22 +0100 (sam, 27 fév 2010) | 2 lines

  Use UTF-8 encoding to create Python test scripts.
........

Lib/test/test_cmd_line_script.py

index 7114681719b7e4826ab2753b848e54a9b494fe71..bc87a22d6d60dd65d9a9ac671e6330041f2f4c68 100644 (file)
@@ -62,7 +62,8 @@ print('sys.argv[0]==%r' % sys.argv[0])
 def _make_test_script(script_dir, script_basename, source=test_source):
     script_filename = script_basename+os.path.extsep+'py'
     script_name = os.path.join(script_dir, script_filename)
-    script_file = open(script_name, 'w')
+    # The script should be encoded to UTF-8, the default string encoding
+    script_file = open(script_name, 'w', encoding='utf-8')
     script_file.write(source)
     script_file.close()
     return script_name