Skip to content

Commit 23b7ee2

Browse files
miss-islingtonrixx
andauthored
bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)
(cherry picked from commit af1ec97) Co-authored-by: Tobias Kunze <[email protected]>
1 parent fff25cc commit 23b7ee2

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, text=None)
42+
encoding=None, errors=None, text=None, env=None)
4343

4444
Run the command described by *args*. Wait for command to complete, then
4545
return a :class:`CompletedProcess` instance.
@@ -78,6 +78,11 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
7878
The *universal_newlines* argument is equivalent to *text* and is provided
7979
for backwards compatibility. By default, file objects are opened in binary mode.
8080

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

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

0 commit comments

Comments
 (0)