summaryrefslogtreecommitdiffstats
path: root/Doc/library/subprocess.rst
diff options
context:
space:
mode:
authorAnders Lorentsen <Phaqui@gmail.com>2018-01-30 07:27:28 (GMT)
committerGregory P. Smith <greg@krypto.org>2018-01-30 07:27:28 (GMT)
commitdd42cb71f2cb02f3a32f016137b12a146bc0d0e2 (patch)
treed37a2ca8d77a012cae351b5f8c6654157a706bee /Doc/library/subprocess.rst
parent14e976e00e65bf343ba0fca016c3c9132a843daf (diff)
downloadcpython-dd42cb71f2cb02f3a32f016137b12a146bc0d0e2.zip
cpython-dd42cb71f2cb02f3a32f016137b12a146bc0d0e2.tar.gz
cpython-dd42cb71f2cb02f3a32f016137b12a146bc0d0e2.tar.bz2
bpo-31961: subprocess now accepts path-like args (GH-4329)
Allow os.PathLike args in subprocess APIs.
Diffstat (limited to 'Doc/library/subprocess.rst')
-rw-r--r--Doc/library/subprocess.rst16
1 files changed, 10 insertions, 6 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 86f3e06..27d4288 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -335,12 +335,12 @@ functions.
the class uses the Windows ``CreateProcess()`` function. The arguments to
:class:`Popen` are as follows.
- *args* should be a sequence of program arguments or else a single string.
- By default, the program to execute is the first item in *args* if *args* is
- a sequence. If *args* is a string, the interpretation is
- platform-dependent and described below. See the *shell* and *executable*
- arguments for additional differences from the default behavior. Unless
- otherwise stated, it is recommended to pass *args* as a sequence.
+ *args* should be a sequence of program arguments or else a single string or
+ :term:`path-like object`. By default, the program to execute is the first
+ item in *args* if *args* is a sequence. If *args* is a string, the
+ interpretation is platform-dependent and described below. See the *shell*
+ and *executable* arguments for additional differences from the default
+ behavior. Unless otherwise stated, it is recommended to pass *args* as a sequence.
On POSIX, if *args* is a string, the string is interpreted as the name or
path of the program to execute. However, this can only be done if not
@@ -551,6 +551,10 @@ functions.
Popen destructor now emits a :exc:`ResourceWarning` warning if the child
process is still running.
+ .. versionchanged:: 3.7
+ *args*, or the first element of *args* if *args* is a sequence, can now
+ be a :term:`path-like object`.
+
Exceptions
^^^^^^^^^^