]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-110383: Document `socket.makefile()` accepts combined modes (GH-119150...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 21 May 2024 18:44:53 +0000 (20:44 +0200)
committerGitHub <noreply@github.com>
Tue, 21 May 2024 18:44:53 +0000 (18:44 +0000)
The supported mode values are 'r', 'w', and 'b', or a combination of those.
(cherry picked from commit 62a29be5bb01c2d0f72d8f9b1b5539816e65310c)

Co-authored-by: Daniel Williams <dann0a@gmail.com>
Doc/library/socket.rst
Lib/socket.py

index 6405f7f00fcb21445def03d808e37031c29bd2ac..2df0257d1f24f0b1b4220c21898f86d4bf719975 100644 (file)
@@ -1589,7 +1589,8 @@ to sockets.
    Return a :term:`file object` associated with the socket.  The exact returned
    type depends on the arguments given to :meth:`makefile`.  These arguments are
    interpreted the same way as by the built-in :func:`open` function, except
-   the only supported *mode* values are ``'r'`` (default), ``'w'`` and ``'b'``.
+   the only supported *mode* values are ``'r'`` (default), ``'w'``, ``'b'``, or
+   a combination of those.
 
    The socket must be in blocking mode; it can have a timeout, but the file
    object's internal buffer may end up in an inconsistent state if a timeout
index 77986fc2e48099f1ce8ba1793e7e1d64370c1129..524ce1361b9091e8472ccba92a59d032146329e0 100644 (file)
@@ -306,7 +306,8 @@ class socket(_socket.socket):
         """makefile(...) -> an I/O stream connected to the socket
 
         The arguments are as for io.open() after the filename, except the only
-        supported mode values are 'r' (default), 'w' and 'b'.
+        supported mode values are 'r' (default), 'w', 'b', or a combination of
+        those.
         """
         # XXX refactor to share code?
         if not set(mode) <= {"r", "w", "b"}: