PEP 433: rationale

This commit is contained in:
Victor Stinner 2013-01-25 00:33:38 +01:00
parent 202ebf92f7
commit 720f0c5f3c
1 changed files with 18 additions and 3 deletions

View File

@ -22,10 +22,25 @@ new file descriptor.
Rationale
=========
XXX recap briefly what the close-on-exec flag does
A file descriptor has a close-on-exec flag which indicates if the file
descriptor will be inherited or not.
On UNIX, subprocess closes file descriptors greater than 2 by default
since Python 3.2 [#subprocess_close]_. All file descriptors created by
On UNIX, the file descriptor will be closed on the execution of child processes
if the close-on-exec flag is set, the file descriptor is inherited by child
processes if the flag is cleared.
On Windows, the file descriptor is not inherited if the close-on-exec flag is
set, the file descriptor is inherited by child processes if the flag is cleared
and if ``CreateProcess()`` is called with the *bInheritHandles* parameter set
to ``TRUE`` (when ``subprocess.Popen`` is created with ``close_fds=False`` for
example).
Status in Python 3.3
--------------------
On UNIX, the subprocess module closes file descriptors greater than 2 by
default since Python 3.2 [#subprocess_close]_. All file descriptors created by
the parent process are automatically closed in the child process.
``xmlrpc.server.SimpleXMLRPCServer`` sets the close-on-exec flag of