Commit 61761205 authored by Victor Stinner's avatar Victor Stinner

(merge 3.2) Issue #12451: distutils now opens the setup script in binary mode

to read the encoding cookie, instead of opening it in UTF-8.
parents d2a69b01 bf799fa9
......@@ -8,7 +8,8 @@ really defined in distutils.dist and distutils.cmd.
__revision__ = "$Id$"
import sys, os
import os
import sys
from distutils.debug import DEBUG
from distutils.errors import *
......@@ -215,11 +216,8 @@ def run_setup (script_name, script_args=None, stop_after="run"):
sys.argv[0] = script_name
if script_args is not None:
sys.argv[1:] = script_args
f = open(script_name)
try:
with open(script_name, 'rb') as f:
exec(f.read(), g, l)
finally:
f.close()
finally:
sys.argv = save_argv
_setup_stop_after = None
......
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