[Python-Dev] PEP 433: Choose the default value of the new cloexec parameter

Victor Stinner victor.stinner at gmail.com
Fri Jan 25 12:28:10 CET 2013


> I think the default behaviour needs to be configurable from the
> environment and the command line, but I don't believe it should be
> configurable from within the interpreter.

sys.setdefaultcloexec() is convinient for unit test, but it may also
be used by modules. A web framework may want to enable close-on-exec
flag by default.

The drawback of changing the default value after Python started is
that Python may have created file descriptors before, so you cannot
guarantee that all existing file descriptors have the flag set.

Well, I don't know if sys.setdefaultcloexec() is a good idea or not :-)

Victor


More information about the Python-Dev mailing list