]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-150952: Fix incorrect sock_sendto docstring (GH-150953) (#154626)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 25 Jul 2026 03:22:42 +0000 (05:22 +0200)
committerGitHub <noreply@github.com>
Sat, 25 Jul 2026 03:22:42 +0000 (08:52 +0530)
gh-150952: Fix incorrect sock_sendto docstring (GH-150953)
(cherry picked from commit 1c4440204f410b2839a44e83ac38cf52eafaadaa)

Co-authored-by: Timofei <128279579+deadlovelll@users.noreply.github.com>
Lib/asyncio/selector_events.py

index f3d2f4eea4d1d9f203ef0a7f15dd52822a574f8a..b6ea2fc0fe045ac7b588043503c63ebc958df64a 100644 (file)
@@ -585,14 +585,10 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
             pos[0] = start
 
     async def sock_sendto(self, sock, data, address):
-        """Send data to the socket.
+        """Send a datagram from sock to address.
 
-        The socket must be connected to a remote socket.  This method
-        continues to send data from data until either all data has been
-        sent or an error occurs.  None is returned on success.  On error,
-        an exception is raised, and there is no way to determine how much
-        data, if any, was successfully processed by the receiving end of
-        the connection.
+        The socket does not have to be connected. This method sends the
+        whole datagram in a single call. Return the number of bytes sent.
         """
         base_events._check_ssl_socket(sock)
         if self._debug and sock.gettimeout() != 0: