Author njs
Recipients asvetlov, christian.heimes, inada.naoki, njs, pitrou, vstinner, yselivanov
Date 2017-12-16.04:25:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513398352.92.0.213398074469.issue32331@psf.upfronthosting.co.za>
In-reply-to
Content
Re-reading my above post, I realized I want to emphasize a little more how odd the current relationship is between socket.type and SOCK_CLOEXEC. Right now, the way it works is:

Python *always* adds SOCK_CLOEXEC to the type that it passes to the operating system when creating a socket. You can later toggle this with socket.set_inheritable, and check it with socket.get_inheritable.

You might expect that you could also check it with (socket.type | SOCK_CLOEXEC), and this does tell you *something*... but it has *no relationship at all* to whether the socket has close-on-exec enabled. Instead, what it tells you whether you passed SOCK_CLOEXEC to the socket constructor. Given that passing SOCK_CLOEXEC to the socket constructor is otherwise *completely ignored*, this seems like a weird piece of information to make available.
History
Date User Action Args
2017-12-16 04:25:52njssetrecipients: + njs, pitrou, vstinner, christian.heimes, asvetlov, inada.naoki, yselivanov
2017-12-16 04:25:52njssetmessageid: <1513398352.92.0.213398074469.issue32331@psf.upfronthosting.co.za>
2017-12-16 04:25:52njslinkissue32331 messages
2017-12-16 04:25:52njscreate