mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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. ........
This commit is contained in:
parent
e94b221d5e
commit
b7f27ff9ac
1 changed files with 2 additions and 1 deletions
|
@ -62,7 +62,8 @@ print('sys.argv[0]==%r' % sys.argv[0])
|
||||||
def _make_test_script(script_dir, script_basename, source=test_source):
|
def _make_test_script(script_dir, script_basename, source=test_source):
|
||||||
script_filename = script_basename+os.path.extsep+'py'
|
script_filename = script_basename+os.path.extsep+'py'
|
||||||
script_name = os.path.join(script_dir, script_filename)
|
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.write(source)
|
||||||
script_file.close()
|
script_file.close()
|
||||||
return script_name
|
return script_name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue