mirror of https://github.com/python/cpython
gh-110383: Document `socket.makefile()` accepts combined modes (#119150)
The supported mode values are 'r', 'w', and 'b', or a combination of those.
This commit is contained in:
parent
0398d93392
commit
62a29be5bb
|
@ -1589,7 +1589,8 @@ to sockets.
|
||||||
Return a :term:`file object` associated with the socket. The exact returned
|
Return a :term:`file object` associated with the socket. The exact returned
|
||||||
type depends on the arguments given to :meth:`makefile`. These arguments are
|
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
|
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
|
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
|
object's internal buffer may end up in an inconsistent state if a timeout
|
||||||
|
|
|
@ -306,7 +306,8 @@ class socket(_socket.socket):
|
||||||
"""makefile(...) -> an I/O stream connected to the socket
|
"""makefile(...) -> an I/O stream connected to the socket
|
||||||
|
|
||||||
The arguments are as for io.open() after the filename, except the only
|
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?
|
# XXX refactor to share code?
|
||||||
if not set(mode) <= {"r", "w", "b"}:
|
if not set(mode) <= {"r", "w", "b"}:
|
||||||
|
|
Loading…
Reference in New Issue