[Python-checkins] bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)

Miss Islington (bot) webhook-mailer at python.org
Tue Jun 5 08:03:05 EDT 2018


https://github.com/python/cpython/commit/23b7ee205270320f836e93e411b28ac995cbabf1
commit: 23b7ee205270320f836e93e411b28ac995cbabf1
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-06-05T05:03:02-07:00
summary:

bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)

(cherry picked from commit af1ec97a6d1dde68b2dc0ee9b78965eb219061a8)

Co-authored-by: Tobias Kunze <r at rixx.de>

files:
M Doc/library/subprocess.rst

diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index fbf2c3d9fac9..58439864f37a 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, text=None)
+                  encoding=None, errors=None, text=None, env=None)
 
    Run the command described by *args*.  Wait for command to complete, then
    return a :class:`CompletedProcess` instance.
@@ -78,6 +78,11 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
    The *universal_newlines* argument is equivalent  to *text* and is provided
    for backwards compatibility. By default, 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



More information about the Python-checkins mailing list