mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
build_scripts command of packaging now handles correctly non-ASCII path (path to the Python executable). Open and write the script in binary mode, but ensure that the shebang is decodable from UTF-8 and from the encoding of the script.
This commit is contained in:
parent
35de5ac44d
commit
cfd365b937
2 changed files with 38 additions and 17 deletions
|
@ -128,10 +128,9 @@ class build_scripts(Command):
|
|||
"The shebang ({!r}) is not decodable "
|
||||
"from the script encoding ({})"
|
||||
.format(shebang, encoding))
|
||||
outf = open(outfile, "wb")
|
||||
outf.write(shebang)
|
||||
outf.writelines(f.readlines())
|
||||
outf.close()
|
||||
with open(outfile, "wb") as outf:
|
||||
outf.write(shebang)
|
||||
outf.writelines(f.readlines())
|
||||
if f:
|
||||
f.close()
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue