https://github.com/python/cpython/commit/a1c20529e2c63a549ce9197ec82f5d8fb597501e
commit: a1c20529e2c63a549ce9197ec82f5d8fb597501e
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: erlend-aasland <[email protected]>
date: 2024-05-21T18:52:56Z
summary:

[3.12] gh-110383: Document `socket.makefile()` accepts combined modes 
(GH-119150) (#119325)

The supported mode values are 'r', 'w', and 'b', or a combination of those.
(cherry picked from commit 62a29be5bb01c2d0f72d8f9b1b5539816e65310c)

Co-authored-by: Daniel Williams <[email protected]>

files:
M Doc/library/socket.rst
M Lib/socket.py

diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index cad03a98b485b8..10f03b3fe0274e 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1584,7 +1584,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
diff --git a/Lib/socket.py b/Lib/socket.py
index 42ee1307732644..d796082e054fa7 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -306,7 +306,8 @@ def makefile(self, mode="r", buffering=None, *,
         """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"}:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to