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

Stephen McInerney spmcinerney at hotmail.com
Mon Mar 26 22:25:40 CEST 2012



Dear esteemed doc folks, 
Re the documentation of subprocess Frequently Used Arguments (line in red below):It's way too vague and misleading ('can be useful'?!).What is not clear is if you have a command with any wildcards in it, it will break in a non-obvious wayPlease change this to explicitly state (on a separate line):
You must use shell=True if the command contains wildcards/globbing (or else call glob/fnmatch manually).
Thanks!Stephen
http://docs.python.org/library/subprocess.html?highlight=subprocess#frequently-used-arguments17.1.1.1. Frequently Used ArgumentsTo support a wide variety of use cases, the Popen constructor (and the convenience functions) accept a large number of optional arguments. For most typical use cases, many of these arguments can be safely left at their default values. The arguments that are most commonly needed are:...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. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20120326/63227e49/attachment.html>


More information about the docs mailing list