From: Eli Bendersky Date: Fri, 15 Apr 2011 04:26:28 +0000 (+0300) Subject: merge from 3.1 X-Git-Tag: v3.2.1b1~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d211231cd51924954c1811ebf271c4499b1323b1;p=thirdparty%2FPython%2Fcpython.git merge from 3.1 --- d211231cd51924954c1811ebf271c4499b1323b1 diff --cc Doc/library/subprocess.rst index bcd38de3e3cb,7188b9570239..f0a632a71cc1 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@@ -662,5 -606,37 +660,39 @@@ Replacing functions from the :mod:`pope * ``stdin=PIPE`` and ``stdout=PIPE`` must be specified. * popen2 closes all file descriptors by default, but you have to specify - ``close_fds=True`` with :class:`Popen`. + ``close_fds=True`` with :class:`Popen` to guarantee this behavior on + all platforms or past Python versions. + + Notes + ----- + + .. _converting-argument-sequence: + + Converting an argument sequence to a string on Windows + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + On Windows, an *args* sequence is converted to a string that can be parsed + using the following rules (which correspond to the rules used by the MS C + runtime): + + 1. Arguments are delimited by white space, which is either a + space or a tab. + + 2. A string surrounded by double quotation marks is + interpreted as a single argument, regardless of white space + contained within. A quoted string can be embedded in an + argument. + + 3. A double quotation mark preceded by a backslash is + interpreted as a literal double quotation mark. + + 4. Backslashes are interpreted literally, unless they + immediately precede a double quotation mark. + + 5. If backslashes immediately precede a double quotation mark, + every pair of backslashes is interpreted as a literal + backslash. If the number of backslashes is odd, the last + backslash escapes the next double quotation mark as + described in rule 3. + ++