Skip to content

Commit 4de6987

Browse files
committed
Cover Windows select capacity above the SDK default
Add local-socket readiness coverage for 65 entries and the Windows 512-entry limit, preserving 513-entry rejection. This regression-only commit intentionally leaves the current Windows 64-entry defect visible before the implementation is added. AI assistance covered regression design, CPython 3.14 source comparison, and automated Linux baseline/reference testing. No manual Windows validation is claimed. Assisted-by: Codex:model-version-unavailable
1 parent bd8fdb7 commit 4de6987

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎extra_tests/snippets/stdlib_select.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ def fileno(self):
8383
b.close()
8484

8585

86+
# Windows supports up to 512 entries, above the Windows SDK default of 64.
87+
for count in (65, 512) if sys.platform == "win32" else (65,):
88+
pairs = []
89+
try:
90+
for _ in range(count):
91+
pairs.append(socket.socketpair())
92+
readers = [reader for reader, writer in pairs]
93+
assert select.select(readers, [], [], 0) == ([], [], [])
94+
for reader, writer in pairs:
95+
writer.send(b"x")
96+
assert select.select(readers, [], [], 0) == (readers, [], [])
97+
if sys.platform == "win32":
98+
assert_raises(ValueError, select.select, [readers[0]] * 513, [], [], 0)
99+
finally:
100+
for pair in pairs:
101+
for sock in pair:
102+
sock.close()
103+
104+
86105
# fileno() runs while the sequence is being read, and it can mutate the very
87106
# list it was handed.
88107
mutable_pair, other_end = socket.socketpair()

0 commit comments

Comments
 (0)