STINNER Victor added the comment:

> Barring any objection, I'll commit the patch attached within a couple days.

I have objections!

You should copy the code from asyncio.windows_utils.socketpair(). It checks 
also type and proto parameter: raise a ValueError for unsupported values (only 
SOCK_STREAM and proto=0 are supported). It also supports IPv6. It handles 
BlockingIOError and InterruptedError on connect (I never understood why these 
exceptions are simply ignored).

You patch checks the address received by accept() and retry. It's a little bit 
surprising. If you get an unexpected connection, maybe an exception should be 
raised, instead of just ignoring it. Maybe we should modify the code in asyncio 
to check also the address?

Finally, please add socketpair() directly to the socket module. It is useful 
for applications, not only for tests.

A socket.socketpair() function available on Windows would help me to write 
tests for the issue #22018!

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18643>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to