don't understand popen2

Martin P. Hellwig mhellwig at
Thu Mar 23 09:28:53 CET 2006

Donn Cave wrote:
> Anyway, it seems unlikely he would get that INVARG error for this
> reason.  That's an error from the host operating system, not the
> interpreter, and it mostly likely refers to the file descriptor.
> Since it works for me, I guess his problem is basically this:
> |> (python 2.4 + win32 extensions on XPProSP2)
> 	Donn Cave, donn at

Thank you for your suggestion.

I shuffled it a bit around and executed it on my BSD box and there 
indeed it works, if I use that exactly program (well not the path var of 
course) on NT it has no error but it still not gives the expected 
results. So I guess that pipes,std-in, std-out & std-err work that 
different on NT then on other POSIX systems.

The lucky thing is that the code where I am exercising for must run on a 
BSD system so my immediately problem is dealt with, but I'm still 
curious how to get this working on NT.

I posted my new code and the results under my sep.

#! /usr/local/bin/python
import popen2

std_out, std_in = popen2.popen2("F:\coding\pwSync\popen_test\")
#! /usr/local/bin/python
someline = raw_input("something:")

if someline == 'test':

results on NT:

results on BSD:

More information about the Python-list mailing list