Skip to content

fix(socketcan): support socket file descriptors over 1023#2057

Open
SAY-5 wants to merge 2 commits into
hardbyte:mainfrom
SAY-5:fix/socketcan-high-fd
Open

fix(socketcan): support socket file descriptors over 1023#2057
SAY-5 wants to merge 2 commits into
hardbyte:mainfrom
SAY-5:fix/socketcan-high-fd

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

Summary of Changes

  • Switch SocketcanBus._recv_internal() and send() from select.select() to select.poll().
  • Add regression test test/test_socketcan_high_fd.py (Linux-only) covering send/recv with a mocked socket whose fd is 2048.
  • Add towncrier news fragment.

Related Issues / Pull Requests

Type of Change

  • Bug fix

Checklist

  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added or updated documentation as appropriate.
  • I have added a news fragment for towncrier.
  • All checks and tests pass (tox).

Additional Notes

select.select() is limited by glibc's FD_SETSIZE (1024) and raises ValueError: filedescriptor out of range in select() for higher fds even when the OS limit allows them. select.poll() has no such limit and returns equivalent readiness data. The change is internal to SocketcanBus; the public send/recv signatures and exception semantics are unchanged.

SAY-5 added 2 commits May 11, 2026 21:01
select.select() is limited by glibc's FD_SETSIZE (1024) and raises
ValueError for higher fds even when the OS limit allows them. Switch
SocketcanBus._recv_internal() and send() to select.poll(), which has
no such limit. Fixes hardbyte#2053.

Signed-off-by: SAY-5 <say.apm35@gmail.com>
Signed-off-by: SAY-5 <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SocketcanBus does not support socket file descriptors over 1023

1 participant