]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-87597: Document TimeoutExpired.stdout & .stderr types (GH-97685)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 30 Sep 2022 17:54:12 +0000 (10:54 -0700)
committerPablo Galindo <pablogsal@gmail.com>
Sat, 22 Oct 2022 19:05:50 +0000 (20:05 +0100)
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 <greg@krypto.org>
Doc/library/subprocess.rst

index 43d6ffceee8fc85786f8385c4ca55752f65fb9b7..dee5bd879db5b5054156c2577fd425910a657e10 100644 (file)
@@ -193,7 +193,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
 
@@ -202,7 +205,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