> Those fd_sets are currently allocated on stack and the array they
> contain is determined currently by FD_SETSIZE. We'll basically need
> a similar structure that we can allocate dynamically, and cast it to
> fd_set when passing it to the select call.
This is possible in Windows. Other platforms are limited to a fixed FD_SETSIZE, in which case the old error should be retained:
if (index >= (unsigned int)FD_SETSIZE) {
PyErr_SetString(PyExc_ValueError,
"too many file descriptors in select()");
goto finally;
}