mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)
This commit is contained in:
parent
e336484847
commit
af1ec97a6d
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue