Skip to content

Commit 94dbdbb

Browse files
[3.9] gh-87597: Document TimeoutExpired.stdout & .stderr types (GH-97685) (GH-97688)
This documents the behavior that has always been the case since timeout support was introduced in Python 3.3. (cherry picked from commit b05dd79) Co-authored-by: Gregory P. Smith <[email protected]>
1 parent 71eddde commit 94dbdbb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Doc/library/subprocess.rst

+7-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
195195
.. attribute:: output
196196

197197
Output of the child process if it was captured by :func:`run` or
198-
:func:`check_output`. Otherwise, ``None``.
198+
:func:`check_output`. Otherwise, ``None``. This is always
199+
:class:`bytes` when any output was captured regardless of the
200+
``text=True`` setting. It may remain ``None`` instead of ``b''``
201+
when no output was observed.
199202

200203
.. attribute:: stdout
201204

@@ -204,7 +207,9 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
204207
.. attribute:: stderr
205208

206209
Stderr output of the child process if it was captured by :func:`run`.
207-
Otherwise, ``None``.
210+
Otherwise, ``None``. This is always :class:`bytes` when stderr output
211+
was captured regardless of the ``text=True`` setting. It may remain
212+
``None`` instead of ``b''`` when no stderr output was observed.
208213

209214
.. versionadded:: 3.3
210215

0 commit comments

Comments
 (0)