[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

R. David Murray report at bugs.python.org
Wed Jun 9 01:57:09 CEST 2010


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

Because we use the versions field to indicate which versions a patch will be applied to, if it is, and I created this bug as a feature request, and as such it is not a candidate for 2.7.

Changing list to string for shell=True is a behavior change (currently excess list elements are passed to the shell...and I don't *know* that that is useless, someone might be exploiting it) and hard to get right.  Changing string to list might be possible on unix using shlex, but is a distinctly non-trivial change, would need to be considered carefully with regard to its implications, and I have no idea what it would mean on Windows.

Since 2.7 is in RC status, there is no way such a fix will be accepted for 2.7.  You can try to make a case for this proposal as a bug fix for 2.7.1, but I'm not sanguine about its chances.  Personally I'm -0.5 on such a change.  I think it is better to leave the control of the command formatting in the hands of the programmer.  Doing such a conversion is too close to guessing for my taste.

If you want a wider selection of opinions you can post the issue to python-dev and request feedback.

----------

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


More information about the Python-bugs-list mailing list