Message308444
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:19 | yselivanov | set | recipients:
+ yselivanov, pitrou, vstinner, christian.heimes, njs, asvetlov, methane |
2017-12-16 03:41:19 | yselivanov | set | messageid: <1513395679.76.0.213398074469.issue32331@psf.upfronthosting.co.za> |
2017-12-16 03:41:19 | yselivanov | link | issue32331 messages |
2017-12-16 03:41:18 | yselivanov | create | |
|