From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:53:07 +0000 (-0700) Subject: gh-87597: Document TimeoutExpired.stdout & .stderr types (GH-97685) X-Git-Tag: v3.10.8~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d7dbcc0b365c9f227a4c299211c068b3da54a90;p=thirdparty%2FPython%2Fcpython.git gh-87597: Document TimeoutExpired.stdout & .stderr types (GH-97685) This documents the behavior that has always been the case since timeout support was introduced in Python 3.3. (cherry picked from commit b05dd796492160c37c9e15e3882f699f411b3461) Co-authored-by: Gregory P. Smith --- diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 45fcfc79522c..f35a8204ce03 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -192,7 +192,10 @@ underlying :class:`Popen` interface can be used directly. .. attribute:: output Output of the child process if it was captured by :func:`run` or - :func:`check_output`. Otherwise, ``None``. + :func:`check_output`. Otherwise, ``None``. This is always + :class:`bytes` when any output was captured regardless of the + ``text=True`` setting. It may remain ``None`` instead of ``b''`` + when no output was observed. .. attribute:: stdout @@ -201,7 +204,9 @@ underlying :class:`Popen` interface can be used directly. .. attribute:: stderr Stderr output of the child process if it was captured by :func:`run`. - Otherwise, ``None``. + Otherwise, ``None``. This is always :class:`bytes` when stderr output + was captured regardless of the ``text=True`` setting. It may remain + ``None`` instead of ``b''`` when no stderr output was observed. .. versionadded:: 3.3