Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit256b791

Browse files
[3.13]gh-110383: Documentsocket.makefile() accepts combined modes (GH-119150) (#119324)
The supported mode values are 'r', 'w', and 'b', or a combination of those.(cherry picked from commit62a29be)Co-authored-by: Daniel Williams <dann0a@gmail.com>
1 parent11ca1d9 commit256b791

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎Doc/library/socket.rst‎

Lines 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‎

Lines 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
ifnotset(mode)<= {"r","w","b"}:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp