[Python-checkins] peps: PEP 433: rationale

victor.stinner python-checkins at python.org
Fri Jan 25 00:35:50 CET 2013


http://hg.python.org/peps/rev/94bec50e4624
changeset:   4688:94bec50e4624
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Jan 25 00:33:38 2013 +0100
summary:
  PEP 433: rationale

files:
  pep-0433.txt |  21 ++++++++++++++++++---
  1 files changed, 18 insertions(+), 3 deletions(-)


diff --git a/pep-0433.txt b/pep-0433.txt
--- a/pep-0433.txt
+++ b/pep-0433.txt
@@ -22,10 +22,25 @@
 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

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list