[Python-checkins] r78502 - in python/branches/release31-maint: Lib/test/test_cmd_line_script.py

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


Author: florent.xicluna
Date: Sat Feb 27 17:17:11 2010
New Revision: 78502

Log:
Merged revisions 78500 via svnmerge from 
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.
........


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Lib/test/test_cmd_line_script.py

Modified: python/branches/release31-maint/Lib/test/test_cmd_line_script.py
==============================================================================
--- python/branches/release31-maint/Lib/test/test_cmd_line_script.py	(original)
+++ python/branches/release31-maint/Lib/test/test_cmd_line_script.py	Sat Feb 27 17:17:11 2010
@@ -62,7 +62,8 @@
 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


More information about the Python-checkins mailing list