From 03b4f0ec4754d78baf71d60c93e381f325795675 Mon Sep 17 00:00:00 2001 From: Brij Date: Thu, 19 Feb 2026 18:12:10 -0500 Subject: [PATCH] improved wording for broken socket for socket.send --- Doc/library/socket.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 24ce0ee56d92a6..67f46fa291c547 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1944,8 +1944,10 @@ to sockets. optional *flags* argument has the same meaning as for :meth:`recv` above. Returns the number of bytes sent. Applications are responsible for checking that all data has been sent; if only some of the data was transmitted, the - application needs to attempt delivery of the remaining data. For further - information on this topic, consult the :ref:`socket-howto`. + application needs to attempt delivery of the remaining data. Unlike :meth:`recv`, + this method will automatically raise an :exc:`OSError` in the case of a broken socket. + As such, there is no need to check the return value to determine if a socket is closed. + For further information on this topic, consult the :ref:`socket-howto`. .. versionchanged:: 3.5 If the system call is interrupted and the signal handler does not raise