[issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED

sbt report at bugs.python.org
Wed Mar 14 15:43:29 CET 2012


sbt <shibturn at gmail.com> added the comment:

pitrou wrote:
> Are you sure this is desired? Nowhere can I think of a place in the
> stdlib where we use overlapped I/O on sockets.

multiprocessing.connection.wait() does overlapped zero length reads on sockets.  It's documentation currently claims that it works with sockets.

Also it would seem strange if some sockets (created with socket()) have the overlapped attribute, but some others (created with WSASocket()) don't.

amaury.forgeotdarc wrote:
> Which problem are you trying to solve?

For one thing, the fact that socketmodule.c does not obey the word "must" in the quote from Microsoft's documentation.

> Can this change be tested somehow?

An additional test could be added to test_multiprocessing.TestWait.

Slightly surprisingly, in the testing I have done so far, using wait() with a duplicated socket seems to work without the patch.  However, I would be rather wary of just assuming that it works in all cases and on all versions of Windows.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14300>
_______________________________________


More information about the Python-bugs-list mailing list