[docs] subprocess Frequently Used Arguments: state explicitly that you must use shell=True if your command has wildcards/globbing

Sandro Tosi sandro.tosi at gmail.com
Sat Mar 31 21:32:14 CEST 2012

Hello Stephen,

On Mon, Mar 26, 2012 at 22:25, Stephen McInerney
<spmcinerney at hotmail.com> wrote:
> You must use shell=True if the command contains wildcards/globbing (or else
> call glob/fnmatch manually).


> If shell is True, the specified command will be executed through the shell.
> This can be useful if you are using Python primarily for the enhanced
> control flow it offers over most system shells and still want access to
> other shell features such as filename wildcards, shell pipes and environment
> variable expansion.

is a much reduced note about shell=True removing some important
information. you want shell=True if you want the commands and
arguments specified to subprocess to be executed like if you writing
in a shell, so with all it's powerful features (some of them enlisted
in the current note).

I don't think we need to change that note, for sure not with the
proposed version.

Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

More information about the docs mailing list