]> granicus.if.org Git - python/commitdiff
Use UTF-8 encoding to create Python test scripts.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 27 Feb 2010 16:12:22 +0000 (16:12 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 27 Feb 2010 16:12:22 +0000 (16:12 +0000)
Lib/test/script_helper.py

index f29143057d40188ca9fb5f8e862babdbb8ba3cd2..144cf660e876c1d6ae4a5631633c01273ddd0420 100644 (file)
@@ -56,7 +56,8 @@ def temp_dir():
 def make_script(script_dir, script_basename, source):
     script_filename = script_basename+os.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