Message110346
Popen from the subprocess module when called with shell=True and executable=/bin/bash still runs in the /bin/sh shell.
The error has been found and corrected in the subprocess module and is as follows:
change:
lines 1018-1022 for python v 2.6
lines 1092-1096 for python v 2.7
lines 1046-1050 for python v 3.1
from this:
if shell:
args = ["/bin/sh", "-c"] + args
if executable is None:
executable = args[0]
to this:
if shell:
if executable is None:
args = ["/bin/sh", "-c"] + args
executable = args[0]
else:
args = [executable, "-c"] + args
# if executable is None:
# executable = args[0]
Of course the last 2 lines can just be deleted but were left in to better highlight the change.
This change corrects the bug allowing shell=True and executable=/bin/bash to run in a bash shell or any other shell sub'd for /bin/bash.
Hope this will make it into the module.
I've included my temp fix which I have simply called subprocess2 for my purposes for v 2.6. |
|
Date |
User |
Action |
Args |
2010-07-15 05:20:55 | narnie | set | recipients:
+ narnie |
2010-07-15 05:20:54 | narnie | set | messageid: <1279171254.35.0.713274753233.issue9265@psf.upfronthosting.co.za> |
2010-07-15 05:20:52 | narnie | link | issue9265 messages |
2010-07-15 05:20:51 | narnie | create | |
|