[Python-checkins] r78500 - python/branches/py3k/Lib/test/script_helper.py

florent.xicluna python-checkins at python.org
Sat Feb 27 17:12:22 CET 2010


Author: florent.xicluna
Date: Sat Feb 27 17:12:22 2010
New Revision: 78500

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


Modified:
   python/branches/py3k/Lib/test/script_helper.py

Modified: python/branches/py3k/Lib/test/script_helper.py
==============================================================================
--- python/branches/py3k/Lib/test/script_helper.py	(original)
+++ python/branches/py3k/Lib/test/script_helper.py	Sat Feb 27 17:12:22 2010
@@ -56,7 +56,8 @@
 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


More information about the Python-checkins mailing list