[issue9265] Can't choose other shell in subprocess

R. David Murray report at bugs.python.org
Thu Jul 15 15:00:15 CEST 2010


R. David Murray <rdmurray at bitdance.com> added the comment:

>From looking at the code, it appears that what happens currently is that executable is used to run /bin/sh when shell=True.  So I'm pretty sure there is a bug here.  What isn't clear is whether or not fixing this bug will cause currently working code to break (that is, we may not be able to backport the fix.)

The patch as given in the message has at minimum some formatting problems, but in any case is not complete.  Later logic in the subprocess code uses 'executable' to run the 'args' string, which means that with this fix you'd be using executable to execute executable.  This might be benign in most cases, but it is certainly wrong and could lead to subtle bugs.

There should also be some doc updates as the current docs implicitly assume that '/bin/sh' is the shell when discussing shell=True cases.  This assumption should be made explicit.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9265>
_______________________________________


More information about the Python-bugs-list mailing list