Nathaniel Smith <n...@pobox.com> added the comment:

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.

----------

_______________________________________
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