Skip to content

[3.6] bpo-32392: Document env keyword argument of subprocess.run() (GH-7289) #7489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down