summaryrefslogtreecommitdiffstats
path: root/Doc/library/subprocess.rst
diff options
context:
space:
mode:
authorTobias Kunze <r@rixx.de>2018-06-05 11:41:42 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2018-06-05 11:41:42 (GMT)
commitaf1ec97a6d1dde68b2dc0ee9b78965eb219061a8 (patch)
tree40d3c94ae26b53ad54ae14d142b24d08fb73f834 /Doc/library/subprocess.rst
parente33648484775fa533fc8f1e5cc45f60061d29d54 (diff)
downloadcpython-af1ec97a6d1dde68b2dc0ee9b78965eb219061a8.zip
cpython-af1ec97a6d1dde68b2dc0ee9b78965eb219061a8.tar.gz
cpython-af1ec97a6d1dde68b2dc0ee9b78965eb219061a8.tar.bz2
bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)
Diffstat (limited to 'Doc/library/subprocess.rst')
-rw-r--r--Doc/library/subprocess.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index fbf2c3d..5843986 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