Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 62a29be

Browse filesBrowse files
authored
gh-110383: Document socket.makefile() accepts combined modes (#119150)
The supported mode values are 'r', 'w', and 'b', or a combination of those.
1 parent 0398d93 commit 62a29be
Copy full SHA for 62a29be

File tree

2 files changed

+4
-2
lines changed
Filter options

2 files changed

+4
-2
lines changed

‎Doc/library/socket.rst

Copy file name to clipboardExpand all lines: Doc/library/socket.rst
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,8 @@ to sockets.
15891589
Return a :term:`file object` associated with the socket. The exact returned
15901590
type depends on the arguments given to :meth:`makefile`. These arguments are
15911591
interpreted the same way as by the built-in :func:`open` function, except
1592-
the only supported *mode* values are ``'r'`` (default), ``'w'`` and ``'b'``.
1592+
the only supported *mode* values are ``'r'`` (default), ``'w'``, ``'b'``, or
1593+
a combination of those.
15931594

15941595
The socket must be in blocking mode; it can have a timeout, but the file
15951596
object's internal buffer may end up in an inconsistent state if a timeout

‎Lib/socket.py

Copy file name to clipboardExpand all lines: Lib/socket.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ def makefile(self, mode="r", buffering=None, *,
306306
"""makefile(...) -> an I/O stream connected to the socket
307307
308308
The arguments are as for io.open() after the filename, except the only
309-
supported mode values are 'r' (default), 'w' and 'b'.
309+
supported mode values are 'r' (default), 'w', 'b', or a combination of
310+
those.
310311
"""
311312
# XXX refactor to share code?
312313
if not set(mode) <= {"r", "w", "b"}:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.