subprocess.Popen inheriting

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Dec 17 18:05:21 EST 2008


En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders  
<jeremy+complangpython at jeremysanders.net> escribió:

> Aaron Brady wrote:
>
>> I thought so too.  The web seems to say that on Linux they are, and on
>> Windows, you need to call DuplicateHandle for it.

Or set bInheritHandle=True when creating the pipe initially. os.pipe()  
doesn't do that.

> I hit this problem - it looks like pipes aren't very versatile on  
> Windows.
> There's also the complicating factor that the handles in windows aren't  
> the
> same as the file numbers that Python uses, so you have to convert between
> them.
>
> It would be nice if Python created pipes that are properly inheritable by
> default by child processes, as they're mostly used for IPC.

I'd say it is a bug in os.pipe implementation; they should be inheritable  
by default, as in posix (after all, the code is in "posixmodule.c").

-- 
Gabriel Genellina




More information about the Python-list mailing list