summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/_msvccompiler.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-06-17 16:32:38 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-06-17 16:32:38 (GMT)
commit08bb8a41cc976343795bd0e241cd7388e9f44ad5 (patch)
treebfd17699100182e075d740b7f87fe2fa59f68a12 /Lib/distutils/_msvccompiler.py
parent85e6635edf4c56064fddd09f5350936dcd650389 (diff)
downloadcpython-08bb8a41cc976343795bd0e241cd7388e9f44ad5.zip
cpython-08bb8a41cc976343795bd0e241cd7388e9f44ad5.tar.gz
cpython-08bb8a41cc976343795bd0e241cd7388e9f44ad5.tar.bz2
Issue #27048: Prevents distutils failing on Windows when environment variables contain non-ASCII characters
Diffstat (limited to 'Lib/distutils/_msvccompiler.py')
-rw-r--r--Lib/distutils/_msvccompiler.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py
index d0ba7d6..b120273 100644
--- a/Lib/distutils/_msvccompiler.py
+++ b/Lib/distutils/_msvccompiler.py
@@ -86,11 +86,9 @@ def _get_vc_env(plat_spec):
try:
out = subprocess.check_output(
- '"{}" {} && set'.format(vcvarsall, plat_spec),
- shell=True,
+ 'cmd /u /c "{}" {} && set'.format(vcvarsall, plat_spec),
stderr=subprocess.STDOUT,
- universal_newlines=True,
- )
+ ).decode('utf-16le', errors='replace')
except subprocess.CalledProcessError as exc:
log.error(exc.output)
raise DistutilsPlatformError("Error executing {}"