Author vstinner
Recipients neologix, pitrou, pturing, python-dev, sbt, vstinner
Date 2014-07-23.20:41:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1406148110.47.0.74760666115.issue18643@psf.upfronthosting.co.za>
In-reply-to
Content
> 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!
History
Date User Action Args
2014-07-23 20:41:50vstinnersetrecipients: + vstinner, pitrou, neologix, python-dev, sbt, pturing
2014-07-23 20:41:50vstinnersetmessageid: <1406148110.47.0.74760666115.issue18643@psf.upfronthosting.co.za>
2014-07-23 20:41:50vstinnerlinkissue18643 messages
2014-07-23 20:41:50vstinnercreate