PEP 446: clarify the status of python 3.3 on Windows

Be more explicit
This commit is contained in:
Victor Stinner 2013-08-11 22:08:03 +02:00
parent 2f67e7cc67
commit a9dd5b6b82
1 changed files with 19 additions and 15 deletions

View File

@ -318,29 +318,31 @@ child process.
On Windows, the ``subprocess`` closes all handles and file descriptors
in the child process by default. If at least one standard stream (stdin,
stdout or stderr) is replaced (ex: redirected into a pipe), all
inheritable handles are inherited in the child process.
inheritable handles and file descriptors 0, 1 and 2 are inherited in the
child process.
All inheritable file descriptors are inherited by the child process
using the functions of the ``os.execv*()`` and ``os.spawn*()`` families.
Using the functions of the ``os.execv*()`` and ``os.spawn*()`` families,
all inheritable handles and all inheritable file descriptors are
inherited by the child process.
On UNIX, the ``multiprocessing`` module uses ``os.fork()`` and so all
file descriptors are inherited by child processes.
On Windows, all inheritable handles are inherited by the child process
using the ``multiprocessing`` module, all file descriptors except
standard streams are closed.
On Windows, all inheritable handles and file descriptors 0, 1 and 2 are
inherited by the child process using the ``multiprocessing`` module, all
file descriptors except standard streams are closed.
Summary:
=========================== ============= ================== =============
Module FD on UNIX Handles on Windows FD on Windows
=========================== ============= ================== =============
subprocess, default STD, pass_fds none STD
subprocess, replace stdout STD, pass_fds all STD
subprocess, close_fds=False all all STD
multiprocessing all all STD
os.execv(), os.spawn() all all all
=========================== ============= ================== =============
=========================== ================ ================== =============
Module FD on UNIX Handles on Windows FD on Windows
=========================== ================ ================== =============
subprocess, default STD, pass_fds none STD
subprocess, replace stdout STD, pass_fds all STD
subprocess, close_fds=False all all STD
multiprocessing (not applicable) all STD
os.execv(), os.spawn() all all all
=========================== ================ ================== =============
Legend:
@ -351,6 +353,8 @@ Legend:
inherited in the child process
* "pass_fds": file descriptors of the *pass_fds* parameter of the
subprocess are inherited
* "(not applicable)": on UNIX, the multiprocessing uses ``fork()``,
so this case is not concerned by this PEP.
Performances of Closing All File Descriptors