[Python-Dev] Accepted: PEP 446 -- Make newly created file descriptors non-inheritable

Victor Stinner victor.stinner at gmail.com
Wed Aug 28 02:08:00 CEST 2013

2013/8/28 Guido van Rossum <guido at python.org>:
> Congratulations Victor, PEP 446 is accepted!

Thanks. I just commited the implementation into default (future Python 3.4):


I tested it on Linux, FreeBSD 9, OpenIndiana and Windows 7. Let see if
the buildbots appreciate non-inheritable file descriptors.

Please test python default on your favorite application to see if the
PEP 446 broke or not! If the PEP 446 breaks your application, don't
worry, it's for the "good of mankind" :-) Adding some calls to
os.set_inheritable(fd, True) and using subprocess with pass_fds should
fix your issues.

I changed the status of the PEP to Final. I also closed the issues
related to the PEP 446:

#10115: Support accept4() for atomic setting of flags at socket creation
#12107: TCP listening sockets created without FD_CLOEXEC flag
#16946: subprocess: _close_open_fd_range_safe() does not set
close-on-exec flag on Linux < 2.6.23 if O_CLOEXEC is defined
#17070: PEP 433: Use the new cloexec to improve security and avoid bugs
#18571: Implementation of the PEP 446: non-inheritable file descriptors


More information about the Python-Dev mailing list