diff options
author | Philip Jenvey <pjenvey@underboss.org> | 2009-09-29 19:18:11 (GMT) |
---|---|---|
committer | Philip Jenvey <pjenvey@underboss.org> | 2009-09-29 19:18:11 (GMT) |
commit | 7865296ca3e6fb179860c899b3a3a198e6f317c1 (patch) | |
tree | 7b48927f5ff54972e19434e9cdb16c2d1bd8ac6d /Lib/os.py | |
parent | b4b94ef437d997ad0619345243a112e744f52245 (diff) | |
download | cpython-7865296ca3e6fb179860c899b3a3a198e6f317c1.zip cpython-7865296ca3e6fb179860c899b3a3a198e6f317c1.tar.gz cpython-7865296ca3e6fb179860c899b3a3a198e6f317c1.tar.bz2 |
Merged revisions 75143 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75143 | philip.jenvey | 2009-09-29 12:10:15 -0700 (Tue, 29 Sep 2009) | 5 lines
#5329: fix os.popen* regression from 2.5: don't execute commands as a sequence
through the shell. also document the correct subprocess replacement for this
case
patch from Jean-Paul Calderone and Jani Hakala
........
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -670,8 +670,9 @@ if _exists("fork"): import subprocess PIPE = subprocess.PIPE - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, - stdin=PIPE, stdout=PIPE, close_fds=True) + p = subprocess.Popen(cmd, shell=isinstance(cmd, basestring), + bufsize=bufsize, stdin=PIPE, stdout=PIPE, + close_fds=True) return p.stdin, p.stdout __all__.append("popen2") @@ -689,9 +690,9 @@ if _exists("fork"): import subprocess PIPE = subprocess.PIPE - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, - stdin=PIPE, stdout=PIPE, stderr=PIPE, - close_fds=True) + p = subprocess.Popen(cmd, shell=isinstance(cmd, basestring), + bufsize=bufsize, stdin=PIPE, stdout=PIPE, + stderr=PIPE, close_fds=True) return p.stdin, p.stdout, p.stderr __all__.append("popen3") @@ -709,8 +710,8 @@ if _exists("fork"): import subprocess PIPE = subprocess.PIPE - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, - stdin=PIPE, stdout=PIPE, + p = subprocess.Popen(cmd, shell=isinstance(cmd, basestring), + bufsize=bufsize, stdin=PIPE, stdout=PIPE, stderr=subprocess.STDOUT, close_fds=True) return p.stdin, p.stdout __all__.append("popen4") |