[Python-checkins] peps: PEP 433: subprocess clears cloexec flag of pass_fds

victor.stinner python-checkins at python.org
Fri Feb 1 00:49:33 CET 2013


http://hg.python.org/peps/rev/a9f8eb11b08b
changeset:   4708:a9f8eb11b08b
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Feb 01 00:48:18 2013 +0100
summary:
  PEP 433: subprocess clears cloexec flag of pass_fds

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


diff --git a/pep-0433.txt b/pep-0433.txt
--- a/pep-0433.txt
+++ b/pep-0433.txt
@@ -174,9 +174,6 @@
 should be modified to conform to this PEP. The new
 ``os.set_cloexec()`` function can be used for example.
 
-XXX Should ``subprocess.Popen`` clear the close-on-exec flag on file
-XXX descriptors of the constructor the ``pass_fds`` parameter?
-
 .. note::
    See `Close file descriptors after fork`_ for a possible solution
    for ``fork()`` without ``exec()``.
@@ -229,6 +226,9 @@
 Add a new command line option ``-e`` and an environment variable
 ``PYTHONCLOEXEC`` to the set close-on-exec flag by default.
 
+``subprocess`` clears the close-on-exec flag of file descriptors of the
+``pass_fds`` parameter.
+
 All functions creating file descriptors in the standard library must
 respect the default *cloexec* parameter (``sys.getdefaultcloexec()``).
 
@@ -284,11 +284,6 @@
 If a file must be inherited by child processes, ``cloexec=False``
 parameter can be used.
 
-``subprocess.Popen`` constructor has an ``pass_fds`` parameter to
-specify which file descriptors must be inherited. The close-on-exec
-flag of these file descriptors must be changed with
-``os.set_cloexec()``.
-
 Advantages of setting close-on-exec flag by default:
 
  * There are far more programs that are bitten by FD inheritance upon

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


More information about the Python-checkins mailing list