[issue8972] subprocess.list2cmdline doesn't quote the & character

R. David Murray report at bugs.python.org
Mon Jun 14 03:55:23 CEST 2010


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

The actual bug here is that list2cmdline is called when shell=True and a list is passed.  This should not be done.  Instead, Popen should raise an TypeError (see issue 7839).

When calling Popen with shell=True, you should be passing in a string that is already correctly quoted.  This is how it works in Unix, and is how it should work in Windows as well.

So I agree with exarkun's comments in msg107679, and I think Gregory's fix in r60115 for issue 1300 was incorrect and that in fact the OP was correct that he did not understand what was happening (note that he did not report an actual bug, he just reported that the code looked wrong to him).

----------
nosy: +gregory.p.smith, r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> pending
superseder:  -> Popen should raise ValueError if pass a string when shell=False or a list when shell=True

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


More information about the Python-bugs-list mailing list