Skip to content

Commit 2795644

Browse files
authored
[3.6] bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)
(cherry picked from commit af1ec97) Conflicts: Doc/library/subprocess.rst
1 parent 2c8d665 commit 2795644

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Doc/library/subprocess.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
3939

4040
.. function:: run(args, *, stdin=None, input=None, stdout=None, stderr=None,\
4141
shell=False, cwd=None, timeout=None, check=False, \
42-
encoding=None, errors=None)
42+
encoding=None, errors=None, env=None)
4343

4444
Run the command described by *args*. Wait for command to complete, then
4545
return a :class:`CompletedProcess` instance.
@@ -75,6 +75,11 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
7575
specified *encoding* and *errors* or the :class:`io.TextIOWrapper` default.
7676
Otherwise, file objects are opened in binary mode.
7777

78+
If *env* is not ``None``, it must be a mapping that defines the environment
79+
variables for the new process; these are used instead of the default
80+
behavior of inheriting the current process' environment. It is passed directly
81+
to :class:`Popen`.
82+
7883
Examples::
7984

8085
>>> subprocess.run(["ls", "-l"]) # doesn't capture output

0 commit comments

Comments
 (0)