Skip to content

Commit 03b4f0e

Browse files
committed
improved wording for broken socket for socket.send
1 parent 4141f0a commit 03b4f0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/socket.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,8 +1944,10 @@ to sockets.
19441944
optional *flags* argument has the same meaning as for :meth:`recv` above.
19451945
Returns the number of bytes sent. Applications are responsible for checking that
19461946
all data has been sent; if only some of the data was transmitted, the
1947-
application needs to attempt delivery of the remaining data. For further
1948-
information on this topic, consult the :ref:`socket-howto`.
1947+
application needs to attempt delivery of the remaining data. Unlike :meth:`recv`,
1948+
this method will automatically raise an :exc:`OSError` in the case of a broken socket.
1949+
As such, there is no need to check the return value to determine if a socket is closed.
1950+
For further information on this topic, consult the :ref:`socket-howto`.
19491951

19501952
.. versionchanged:: 3.5
19511953
If the system call is interrupted and the signal handler does not raise

0 commit comments

Comments
 (0)