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

Andrew Svetlov report at bugs.python.org
Sun Apr 1 12:06:50 CEST 2012


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

After trying to make a patch I found what current test suite itself has calls like (str, shell=False), (bytes, shell=True) and (['shell command'], shell=True).

We can:
1. Implement Eric's suggestion with fixing/removing broken tests.
2. Add Pope.shell and Popen.exec as Nick propose.

I don't like former because it changes already existing contracts fixed and published by explicit unittests without strong reason. Also Nick pointed reasons why user may need existing functionality. Adding new 'safe' shell and exec classmethods as prime entrypoints for Popen make sense.

----------

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


More information about the Python-bugs-list mailing list