summaryrefslogtreecommitdiffstats
path: root/Lib/test/script_helper.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-02-27 16:12:22 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-02-27 16:12:22 (GMT)
commit8de42e2d50e9609ef4f9a656a0b8e1234db969ac (patch)
tree438fe229335223353375758c0113c9f9b222a632 /Lib/test/script_helper.py
parentda734e17bbfe38b50ad4ca384a2241b9272a21bd (diff)
downloadcpython-8de42e2d50e9609ef4f9a656a0b8e1234db969ac.zip
cpython-8de42e2d50e9609ef4f9a656a0b8e1234db969ac.tar.gz
cpython-8de42e2d50e9609ef4f9a656a0b8e1234db969ac.tar.bz2
Use UTF-8 encoding to create Python test scripts.
Diffstat (limited to 'Lib/test/script_helper.py')
-rw-r--r--Lib/test/script_helper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py
index f291430..144cf66 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