Commit 09653b85 authored by Victor Stinner's avatar Victor Stinner

Issue #10419, issue #6011: port 6ad356525381 fix from distutils to packaging

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.
parent a2a23f60
......@@ -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")
with open(outfile, "wb") as outf:
outf.write(shebang)
outf.writelines(f.readlines())
outf.close()
if f:
f.close()
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment