Author: Matti Picus <[email protected]>
Branch:
Changeset: r70381:6513cd57d9d5
Date: 2014-04-01 23:36 +0300
http://bitbucket.org/pypy/pypy/changeset/6513cd57d9d5/
Log: complete the other half of f43ca379c4c9, Popen with shell=True
passes env properly on win32
diff --git a/rpython/tool/runsubprocess.py b/rpython/tool/runsubprocess.py
--- a/rpython/tool/runsubprocess.py
+++ b/rpython/tool/runsubprocess.py
@@ -11,6 +11,9 @@
def run_subprocess(executable, args, env=None, cwd=None):
return _run(executable, args, env, cwd)
+shell_default = False
+if sys.platform == 'win32':
+ shell_default = True
def _run(executable, args, env, cwd): # unless overridden below
if isinstance(args, str):
@@ -21,7 +24,9 @@
args = [str(executable)]
else:
args = [str(executable)] + args
- shell = False
+ # shell=True on unix-like is a known security vulnerability, but
+ # on windows shell=True does not properly propogate the env dict
+ shell = shell_default
# Just before spawning the subprocess, do a gc.collect(). This
# should help if we are running on top of PyPy, if the subprocess
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit