summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2018-06-07 19:22:35 (GMT)
committerGitHub <noreply@github.com>2018-06-07 19:22:35 (GMT)
commit279564431e8e2fa4c20e8850420caea484a5d20b (patch)
treefbd47089b4a5f795df02e7601604f7a89ba721e6
parent2c8d665ba843fe875a4b8f0ae7c7e9099a06f0dc (diff)
downloadcpython-279564431e8e2fa4c20e8850420caea484a5d20b.zip
cpython-279564431e8e2fa4c20e8850420caea484a5d20b.tar.gz
cpython-279564431e8e2fa4c20e8850420caea484a5d20b.tar.bz2
[3.6] bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)
(cherry picked from commit af1ec97a6d1dde68b2dc0ee9b78965eb219061a8) Conflicts: Doc/library/subprocess.rst
-rw-r--r--Doc/library/subprocess.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 6a5f276..f624adb 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -39,7 +39,7 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
.. function:: run(args, *, stdin=None, input=None, stdout=None, stderr=None,\
shell=False, cwd=None, timeout=None, check=False, \
- encoding=None, errors=None)
+ encoding=None, errors=None, env=None)
Run the command described by *args*. Wait for command to complete, then
return a :class:`CompletedProcess` instance.
@@ -75,6 +75,11 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
specified *encoding* and *errors* or the :class:`io.TextIOWrapper` default.
Otherwise, file objects are opened in binary mode.
+ If *env* is not ``None``, it must be a mapping that defines the environment
+ variables for the new process; these are used instead of the default
+ behavior of inheriting the current process' environment. It is passed directly
+ to :class:`Popen`.
+
Examples::
>>> subprocess.run(["ls", "-l"]) # doesn't capture output