os.pipe and subprocess under Windows

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Mon Nov 17 11:34:34 CET 2008

Jeremy Sanders wrote:

> As far as I understand, child processes should inherit file
> descriptors from the parent if close_fds=False on the suprocess.Popen
> command line.
> This code doesn't work under Window, but gives "bad file descriptor" when
> trying to read from the pipe in the child process.


    If close_fds is true, all file descriptors except 0, 1 and 2 will be
    closed before the child process is executed. (Unix only). Or, on
    Windows, if close_fds is true then no handles will be inherited by the
    child process.

Windows has no fork(2).

More information about the Python-list mailing list