Author yselivanov
Recipients asvetlov, christian.heimes, inada.naoki, njs, pitrou, vstinner, yselivanov
Date 2017-12-16.03:41:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513395679.76.0.213398074469.issue32331@psf.upfronthosting.co.za>
In-reply-to
Content
I've been thinking a lot about this problem, and I'm really tempted to fix sock.type property:

1. The problem first appeared in Python 3.2.

2. Python 2.7 doesn't have this problem at all, and doesn't even export socket.SOCK_NONBLOCK.  If we fix this in 3.7 it *will* actually help some poor souls with porting their network applications.

3. People use Python when they want a high-level portable language.  This annoying Linux quirk makes it super hard to write correct socket code.

4. I can't actually come up with any decent Linux-only example of using this quirk of socket.type.  Why would one check if sock.type has SOCK_NONBLOCK?  And even if they check it, one call to sock.settimeout() will make sock.type information outdated and simply wrong.

Let's just fix sock.type?
History
Date User Action Args
2017-12-16 03:41:19yselivanovsetrecipients: + yselivanov, pitrou, vstinner, christian.heimes, njs, asvetlov, inada.naoki
2017-12-16 03:41:19yselivanovsetmessageid: <1513395679.76.0.213398074469.issue32331@psf.upfronthosting.co.za>
2017-12-16 03:41:19yselivanovlinkissue32331 messages
2017-12-16 03:41:18yselivanovcreate