From: <pj...@us...> - 2009-09-09 03:06:38
|
Revision: 6767 http://jython.svn.sourceforge.net/jython/?rev=6767&view=rev Author: pjenvey Date: 2009-09-09 03:06:20 +0000 (Wed, 09 Sep 2009) Log Message: ----------- fix os.popen*/popen2 to only invoke a shell if cmd is a string refs http://bugs.python.org/issue5329 Modified Paths: -------------- trunk/jython/Lib/popen2.py Modified: trunk/jython/Lib/popen2.py =================================================================== --- trunk/jython/Lib/popen2.py 2009-09-09 02:58:36 UTC (rev 6766) +++ trunk/jython/Lib/popen2.py 2009-09-09 03:06:20 UTC (rev 6767) @@ -34,7 +34,8 @@ process.""" stderr = subprocess.PIPE if capturestderr else None PIPE = subprocess.PIPE - self._popen = subprocess.Popen(cmd, bufsize=bufsize, shell=True, + self._popen = subprocess.Popen(cmd, bufsize=bufsize, + shell=isinstance(cmd, basestring), stdin=PIPE, stdout=PIPE, stderr=stderr) self._setup(cmd) @@ -73,7 +74,8 @@ def __init__(self, cmd, bufsize=-1): PIPE = subprocess.PIPE - self._popen = subprocess.Popen(cmd, bufsize=bufsize, shell=True, + self._popen = subprocess.Popen(cmd, bufsize=bufsize, + shell=isinstance(cmd, basestring), stdin=PIPE, stdout=PIPE, stderr=subprocess.STDOUT) self._setup(cmd) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |