# I'm not sure about netiquette here:
# I decided to continue posting to the python-list without CCing to
[I assume you mean python-dev]
Discussing this issue on the list is fine. Posting code is on the borderline, and will have no effect, i.e. no action will come out of (at least I will ignore the code entirely, unless it is an actual patch, and submitted to the bug tracker).
So perhaps, for Python development, we just have to accept that the problem persists and that at this time a 100% solution just does not exist - and we should watch the discussion on http://lwn.net/Articles/237722/ to see how they solve it for Linux.
Exactly. My proposal is still to provide an API to toggle the flag after the handle was created.
Martin, you mentioned that for sockets, inheritance is not a problem unless accept(), recv() or select() is called in the child process (as far as I understood it).
I did not say "no problems". I said "there is no ambiguity whereto direct the data if the child processes don't perform accept/recv".
Sure: the system will not shutdown the connection as long as the handle is still open in the subprocess (as the subprocess might send more data - which it won't).
I think the problem could be avoided by the parent process explicitly performing shutdown(2), but I'm uncertain as I have never actively used shutdown().
I don't understand how this is relevant. This is about CLO_EXEC not being available on Windows, and has nothing to do with socket inheritance.
Not surprisingly - they don't support fork(). If they would, they could not have made that change. The bug report is the same issue: clients will be able to connect as long as the listen backlog fills. Then they will be turned down, as notepad will never perform accept.
[I'm getting bored trying to explain the other cases as well]
Any Windows Guru around who can explain what's going on with socket handles and CreateProcess? I mean - is the explanation Martin gave for accept(), recv(), select() correct for Windows, too? And if so - how can the errors be explained that are mentioned in the URLs above?
See my explanation above.