[docs] [issue21347] Don't use a list argument together with shell=True in subprocess' docs

akira report at bugs.python.org
Thu Apr 24 21:08:42 CEST 2014


New submission from akira:

*Popen(["something"], shell=True)* works but it is similar to
*Popen(["something", "arg"], shell=True)* that passes "arg" to /bin/sh on POSIX systems instead of "something".

It is best to always use a string if `shell=True` is necessary.

It is a common confusion #20344, msg98732, #7839

http://stackoverflow.com/questions/21029154/understanding-python-subprocess-check-outputs-first-argument-and-shell-true
http://stackoverflow.com/questions/20787712/start-openoffice-process-with-python-to-use-with-pyuno-using-subprocess
http://stackoverflow.com/questions/17880847/python-subprocess-error-in-using-cp
http://stackoverflow.com/questions/17226912/why-does-simple-echo-in-subprocess-not-working
http://stackoverflow.com/questions/15109665/subprocess-call-using-string-vs-using-list
http://stackoverflow.com/questions/20128114/pythons-subprocess-does-not-interpret-as-expected-on-cygwin
http://stackoverflow.com/questions/16840427/python-on-linux-subprocess-popen-works-weird-with-shell-true
...

----------
assignee: docs at python
components: Documentation
files: docs-subprocess-dont_use_list_with_shell_true.patch
keywords: patch
messages: 217136
nosy: akira, docs at python
priority: normal
severity: normal
status: open
title: Don't use a list argument together with shell=True in subprocess' docs
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file35026/docs-subprocess-dont_use_list_with_shell_true.patch

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


More information about the docs mailing list