Message291733
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? |
|
Date |
User |
Action |
Args |
2017-04-16 03:10:04 | iMath | set | recipients:
+ iMath, docs@python |
2017-04-16 03:10:04 | iMath | set | messageid: <1492312204.85.0.288489442565.issue30079@psf.upfronthosting.co.za> |
2017-04-16 03:10:04 | iMath | link | issue30079 messages |
2017-04-16 03:10:03 | iMath | create | |
|