-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
The implementation of socket.send_fds does not pass flags and address down to sock.sendmsg:
Lines 553 to 559 in bf70774
| def send_fds(sock, buffers, fds, flags=0, address=None): | |
| """ send_fds(sock, buffers, fds[, flags[, address]]) -> integer | |
| Send the list of file descriptors fds over an AF_UNIX socket. | |
| """ | |
| return sock.sendmsg(buffers, [(_socket.SOL_SOCKET, | |
| _socket.SCM_RIGHTS, array.array("i", fds))]) |
The fix seems trivial, I can submit a PR.
Checklist
- I am confident this is a bug in CPython, not a bug in a third-party project
- I have searched the CPython issue tracker, and am confident this bug has not been reported before
A clear and concise description of the bug
import os
import socket
sock = socket.socket(family=socket.AF_UNIX, type=socket.SOCK_DGRAM)
fd = os.memfd_create("journal_entry")
socket.send_fds(sock=sock, buffers=[], fds=[fd], address="/run/systemd/journal/socket")fails with
return sock.sendmsg(buffers, [(_socket.SOL_SOCKET,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 107] Transport endpoint is not connected
Your environment
- CPython versions tested on: 3.11.3
- Operating system and architecture: Linux-6.1.43-1-rpi-ARCH-armv7l-with-glibc2.35
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error