[issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True

R. David Murray report at bugs.python.org
Sun Apr 16 12:49:50 EDT 2017


R. David Murray added the comment:

Note the subtlety here on unix:

rdmurray at pydev:~/python/p36[3.6]>cat temp.sh
#!/bin/bash
echo $0
echo $1

>>> subprocess.call(['./temp.sh', 'spam', 'eggs'], shell=True)
./temp.sh


0
>>> subprocess.call(['./temp.sh $0 $1', 'spam', 'eggs'], shell=True)
./temp.sh
spam
eggs
0

----------

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


More information about the Python-bugs-list mailing list