[Python-Dev] Fix to allow os.popen to work from pythonw.exe

Greg Stein gstein@lyra.org
Sat, 8 Jul 2000 06:14:18 -0700


Bill has done a ton of stuff with popen() on Windows. I'm CC'ing him to make
sure that he sees this.

Cheers,
-g

On Sat, Jul 08, 2000 at 03:01:21PM +0200, Fredrik Lundh wrote:
> barry scott wrote:
> > os.popen fails to work if pythonw.exe is used to start python. This is
> > true for 1.5.2 and 1.6a2.
> > 
> > The root cause of the problem is in the Microsoft C RTL implementation
> > of _popen(). _popen() will fail if there is not a valid file descriptor
> > for stdin or stdout.
> > 
> > The following replacement for WinMain.c works around the problem.
> > I also ensure a valid descriptor for stderr for completeness.
> > 
> > This was compiled and test under VC++ 6.0 SP3 on Windows 2000.
> 
> +1 from me.
> 
> unless mark|bill|trent|.+ objects, I'll check it in later.
> 
> cheers /F
> 
> PS. I've uploaded it to the SF patch manager:
> http://sourceforge.net/patch/index.php?patch_id=100764&group_id=5470
> 
> 
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://www.python.org/mailman/listinfo/python-dev

-- 
Greg Stein, http://www.lyra.org/