Christian Heimes <li...@cheimes.de> added the comment:

Python's handling of socket has multiple issues, see #28134 for more fun. At 
the moment the values of type, family and protocol are unreliable at best and 
dangerously wrong at worst. The attributes are only correct if and only if the 
socket has not been created from a file descriptor and the socket hasn't been 
manipulated with ioctl or setsockopt().

Now to the issue at hand. I'm -1 on applying a mask to type. You can easily 
work around your problem by replacing "sock.type == SOCK_STREAM" with 
"sock.type & SOCK_STREAM == SOCK_STREAM".

----------
nosy: +christian.heimes

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

Reply via email to