Author christian.heimes
Recipients asvetlov, christian.heimes, inada.naoki, pitrou, vstinner, yselivanov
Date 2017-12-15.10:20:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513333242.7.0.213398074469.issue32331@psf.upfronthosting.co.za>
In-reply-to
Content
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".
History
Date User Action Args
2017-12-15 10:20:42christian.heimessetrecipients: + christian.heimes, pitrou, vstinner, asvetlov, inada.naoki, yselivanov
2017-12-15 10:20:42christian.heimessetmessageid: <1513333242.7.0.213398074469.issue32331@psf.upfronthosting.co.za>
2017-12-15 10:20:42christian.heimeslinkissue32331 messages
2017-12-15 10:20:42christian.heimescreate