From: Florent Xicluna Date: Sat, 27 Feb 2010 16:12:22 +0000 (+0000) Subject: Use UTF-8 encoding to create Python test scripts. X-Git-Tag: v3.2a1~1610 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8de42e2d50e9609ef4f9a656a0b8e1234db969ac;p=thirdparty%2FPython%2Fcpython.git Use UTF-8 encoding to create Python test scripts. --- diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py index f29143057d40..144cf660e876 100644 --- a/Lib/test/script_helper.py +++ b/Lib/test/script_helper.py @@ -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