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 christian.heimes
Recipients asvetlov, christian.heimes, methane, pitrou, vstinner, yselivanov
Date 2017-12-15.10:20:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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".
Date User Action Args
2017-12-15 10:20:42christian.heimessetrecipients: + christian.heimes, pitrou, vstinner, asvetlov, methane, yselivanov
2017-12-15 10:20:42christian.heimessetmessageid: <>
2017-12-15 10:20:42christian.heimeslinkissue32331 messages
2017-12-15 10:20:42christian.heimescreate