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 vstinner
Recipients BreamoreBoy, exarkun, giampaolo.rodola, lekma, neologix, nvetoshkin, pitrou, r.david.murray, vstinner
Date 2014-04-22.21:51:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwaMscdgx0DUdBxCsdQ1=Dv-nuuXu0mkcp7jrcv8G0NFEw@mail.gmail.com>
In-reply-to <1398199342.85.0.554483602393.issue21327@psf.upfronthosting.co.za>
Content
I would prefer to add something to get the type without SOCK_NONBLOCK nor
SOCK_CLOEXEC. So new feature can only be added to Python 3.5. For older
Python versions, you can to filter manually, which is difficult because you
have yo check if SOCK_NONBLOCK and/or SOCK_CLOEXEC are available. You have
the same issue in the C language.

Anyway, all sockets are now created with SOCK_CLOEXEC since Python 3.4
because of the PEP 446 (cloexec).

We can add a new .sock_type attribute. Or .type could be an object with
attributes like: type (int/enum), cloexec, nonblock, etc.

Or simply a short helper method can be added. Ex:
socket.get_socket_type(sock) or socket.get_socket_type(sock.type).
History
Date User Action Args
2014-04-22 21:51:36vstinnersetrecipients: + vstinner, exarkun, pitrou, giampaolo.rodola, r.david.murray, lekma, nvetoshkin, neologix, BreamoreBoy
2014-04-22 21:51:36vstinnerlinkissue21327 messages
2014-04-22 21:51:36vstinnercreate