mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Use UTF-8 encoding to create Python test scripts.
This commit is contained in:
parent
da734e17bb
commit
8de42e2d50
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue