[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags
report at bugs.python.org
Sun Nov 21 20:45:45 CET 2010
Antoine Pitrou <pitrou at free.fr> added the comment:
> > Anyway, my personal opinion is that we should consider the current
> > behavior a bug and fix it. I like the idea of setting all accepted
> > sockets to blocking mode (and documenting it clearly).
> > I think it is what most people would expect.
> Apparently, the designers of BSD thought differently. Remember that
> it is them who defined the socket API in the first place, so they
> have the right that their design decisions are considered.
We are talking about the timeout feature, which is a Python feature, not
a BSD (or Linux) sockets feature. It should work properly, even if that
means adding some boilerplate around system calls.
> We should also take issue10115 into account, which proposes changes
> to accept on Linux. One solution might to add optional flags to
> accept(), asking for certain behavior variations.
Adding flags to control inheritance could be done. But here the problem
is that the behaviour is buggy even without assuming the API makes any
promise w.r.t. inheritance.
(in other words, while issue10115 is a feature request, this issue is
really a bug)
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list