We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f03c42 commit bf67bd8Copy full SHA for bf67bd8
Doc/library/socket.rst
@@ -1567,6 +1567,7 @@ to sockets.
1567
.. method:: socket.send_fds(sock, buffers, fds[, flags[, address]])
1568
1569
Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket.
1570
+ The *fds* parameter is a sequence of file descriptors.
1571
Consult :meth:`sendmsg` for the documentation of these parameters.
1572
1573
.. availability:: Unix supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` mechanism.
@@ -1578,7 +1579,7 @@ to sockets.
1578
1579
Receive up to *maxfds* file descriptors. Return ``(msg, list(fds), flags, addr)``. Consult
1580
:meth:`recvmsg` for the documentation of these parameters.
1581
- .. availability:: Unix supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` mechanism.
1582
+ .. availability:: Unix supporting :meth:`~socket.recvmsg` and :const:`SCM_RIGHTS` mechanism.
1583
1584
.. versionadded:: 3.9
1585
Lib/socket.py
@@ -469,7 +469,7 @@ def fromfd(fd, family, type, proto=0):
469
import array
470
471
def send_fds(sock, buffers, fds, flags=0, address=None):
472
- """ send_fds(sock, buffers, fds[, flags[, address]]) -> socket object
+ """ send_fds(sock, buffers, fds[, flags[, address]]) -> integer
473
474
Send the list of file descriptors fds over an AF_UNIX socket.
475
"""
@@ -481,9 +481,10 @@ def send_fds(sock, buffers, fds, flags=0, address=None):
481
482
483
def recv_fds(sock, bufsize, maxfds, flags=0):
484
- """ recv_fds(sock, bufsize, maxfds[, flags]) -> (socket object, socket object)
+ """ recv_fds(sock, bufsize, maxfds[, flags]) -> (data, list of file
485
+ descriptors, msg_flags, address)
486
- receive up to maxfds file descriptors returning the message
487
+ Receive up to maxfds file descriptors returning the message
488
data and a list containing the descriptors.
489
490
# Array of ints
Lib/test/test_socket.py
@@ -6279,7 +6279,7 @@ def close_fds(fds):
6279
with sock1, sock2:
6280
socket.send_fds(sock1, [MSG], fds)
6281
# request more data and file descriptors than expected
6282
- msg, fds2, flags, addr = socket.recv_fds(sock2, len(MSG) * 2, len(fds) * 2)
+ msg, fds2, flags, addr = socket.recv_fds(sock2, len(MSG) * 2, len(fds) * 2)
6283
self.addCleanup(close_fds, fds2)
6284
6285
self.assertEqual(msg, MSG)
0 commit comments