Skip to content
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
23 changes: 15 additions & 8 deletions 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, text=None)

Run the command described by *args*. Wait for command to complete, then
return a :class:`CompletedProcess` instance.
Expand Down Expand Up @@ -267,7 +267,8 @@ default values. The arguments that are most commonly needed are:
.. index::
single: universal newlines; subprocess module

If *encoding* or *errors* are specified, or *universal_newlines* is true,
If *encoding* or *errors* are specified, or *text* (also known as
*universal_newlines*) is true,
the file objects *stdin*, *stdout* and *stderr* will be opened in text
mode using the *encoding* and *errors* specified in the call or the
defaults for :class:`io.TextIOWrapper`.
Expand All @@ -284,6 +285,9 @@ default values. The arguments that are most commonly needed are:
.. versionadded:: 3.6
Added *encoding* and *errors* parameters.

.. versionadded:: 3.7
Added the *text* parameter as an alias for *universal_newlines*.

.. note::

The newlines attribute of the file objects :attr:`Popen.stdin`,
Expand Down Expand Up @@ -328,7 +332,7 @@ functions.
cwd=None, env=None, universal_newlines=False, \
startupinfo=None, creationflags=0, restore_signals=True, \
start_new_session=False, pass_fds=(), *, \
encoding=None, errors=None)
encoding=None, errors=None, text=None)

Execute a child program in a new process. On POSIX, the class uses
:meth:`os.execvp`-like behavior to execute the child program. On Windows,
Expand Down Expand Up @@ -511,15 +515,18 @@ functions.

.. _side-by-side assembly: https://en.wikipedia.org/wiki/Side-by-Side_Assembly

If *encoding* or *errors* are specified, the file objects *stdin*, *stdout*
and *stderr* are opened in text mode with the specified encoding and
*errors*, as described above in :ref:`frequently-used-arguments`. If
*universal_newlines* is ``True``, they are opened in text mode with default
encoding. Otherwise, they are opened as binary streams.
If *encoding* or *errors* are specified, or *text* is true, the file objects
*stdin*, *stdout* and *stderr* are opened in text mode with the specified
encoding and *errors*, as described above in :ref:`frequently-used-arguments`.
The *universal_newlines* argument is equivalent to *text* and is provided
for backwards compatibility. By default, file objects are opened in binary mode.

.. versionadded:: 3.6
*encoding* and *errors* were added.

.. versionadded:: 3.7
*text* was added as a more readable alias for *universal_newlines*.

If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is
passed to the underlying ``CreateProcess`` function.
*creationflags*, if given, can be one or more of the following flags:
Expand Down