This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients asvetlov, christian.heimes, methane, njs, pitrou, vstinner, yselivanov
Date 2017-12-16.03:41:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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?
Date User Action Args
2017-12-16 03:41:19yselivanovsetrecipients: + yselivanov, pitrou, vstinner, christian.heimes, njs, asvetlov, methane
2017-12-16 03:41:19yselivanovsetmessageid: <>
2017-12-16 03:41:19yselivanovlinkissue32331 messages
2017-12-16 03:41:18yselivanovcreate