[issue12107] TCP listening sockets created without FD_CLOEXEC flag

Charles-François Natali report at bugs.python.org
Sat May 21 16:50:27 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

$ cat test_sock.py 
import socket
import fcntl


with socket.socket(socket.AF_INET, socket.SOCK_STREAM|socket.SOCK_CLOEXEC) as s:
    print(bool(fcntl.fcntl(s, fcntl.F_GETFD) & fcntl.FD_CLOEXEC))

$ ./python test_sock.py 
True

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12107>
_______________________________________


More information about the Python-bugs-list mailing list