New submission from Philip Lee:

The doc here 
https://docs.python.org/3/library/subprocess.html#subprocess.Popen
says :
"If shell is True, it is recommended to pass args as a string rather than as a 
sequence."
but without explain why ? Please add the explanation !
while in
https://docs.python.org/3/library/subprocess.html#frequently-used-arguments
says:
"args is required for all calls and should be a string, or a sequence of 
program arguments. Providing a sequence of arguments is generally preferred, as 
it allows the module to take care of any required escaping and quoting of 
arguments (e.g. to permit spaces in file names). If passing a single string, 
either shell must be True (see below) or else the string must simply name the 
program to be executed without specifying any arguments."

In the case of shell =True ,  I found providing a sequence of arguments  rather 
than  a string argument can take the advantage of auto escaping and quoting of 
arguments (e.g. to permit spaces in file names) , so what is the advantage of 
pass args as a string rather than as a sequence as says in the doc when shell 
is True?

----------
assignee: docs@python
components: Documentation
messages: 291733
nosy: docs@python, iMath
priority: normal
severity: normal
status: open
title: Explain why it is recommended to pass args as a string rather than as a 
sequence If shell is True
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30079>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to