Skip to content

Commit b9efe10

Browse files
authored
Add missing test for select.select() (#7953)
This is a follow up for #7948
1 parent d3272e7 commit b9efe10

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

extra_tests/snippets/stdlib_select.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ def fileno(self):
6262
resource.setrlimit(resource.RLIMIT_NOFILE, (soft_max_fds, hard_max_fds))
6363
sockets = [s for _ in range(TOO_MANY_SELECT_FDS // 2) for s in socket.socketpair()]
6464
assert_raises(ValueError, select.select, sockets, [], [], 0)
65+
if sys.platform != "win32":
66+
# Try to overflow descriptor bit mask on *nix with a single item
67+
max_fd = -1
68+
max_fd_sock = None
69+
sockets.reverse()
70+
for sock in sockets:
71+
if sock.fileno() > max_fd:
72+
max_fd = sock.fileno()
73+
max_fd_sock = sock
74+
assert_raises(ValueError, select.select, [max_fd_sock], [], [], 0)
6575
del sockets
6676
a, b = socket.socketpair()
6777
# CPython disallows this on *nix systems too.

0 commit comments

Comments
 (0)