diff -r 6a0def54c63d Doc/library/subprocess.rst --- a/Doc/library/subprocess.rst Tue Mar 25 12:51:08 2014 +0100 +++ b/Doc/library/subprocess.rst Sat Jun 20 06:14:40 2015 +0000 @@ -276,15 +276,16 @@ To support a wide variety of use cases, the :class:`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: +default values. The arguments that are most commonly needed +are described below. All arguments are also described in more +detail in the :class:`Popen` constructor documentation. - *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 :const:`True` (see below) or else - the string must simply name the program to be executed without specifying - any arguments. + The *args* argument is required for all calls and should be a string, + or a sequence of program arguments. When *shell* is false (the default), + providing a sequence of program arguments is generally preferred, as + it means the same thing on all platforms, and allows the module to + take care of escaping and quoting of arguments, which is required on + Windows. *stdin*, *stdout* and *stderr* specify the executed program's standard input, standard output and standard error file handles, respectively. Valid values @@ -320,7 +321,8 @@ :attr:`Popen.stdout` and :attr:`Popen.stderr` are not updated by the :meth:`Popen.communicate` method. - If *shell* is ``True``, the specified command will be executed through + If *shell* is ``True``, *args* is normally a string (rather than a + sequence of arguments) specifying a command that 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 convenient access to other shell features such as shell pipes, filename @@ -359,9 +361,6 @@ escape whitespace and shell metacharacters in strings that are going to be used to construct shell commands. -These options, along with all of the other options, are described in more -detail in the :class:`Popen` constructor documentation. - Popen Constructor ^^^^^^^^^^^^^^^^^ @@ -437,6 +436,8 @@ ``shell=True`` on Windows is when the command you wish to execute is built into the shell (e.g. :command:`dir` or :command:`copy`). You do not need ``shell=True`` to run a batch file or console-based executable. + If *args* is a sequence, the quoting is likely to be incorrect, but + no error will be directly raised. .. warning::