[python-win32] Starting a process in unbuffered mode using Python 2.3

Tim Roberts timr at probo.com
Wed Jun 13 19:05:48 CEST 2007

Tor Erik Sønvisen wrote:
> I have this problem with piping stdin and stdout of a child process in
> windows. The basic problem is that I'm unable to start the child
> process in unbuffered mode. I've tried os.popen3 with bufsize=0, but
> then I get en Exception saying that bufsize must be -1 (no size
> restriction).

Have you tried using the same kind of technique that subprocess does, by
calling os.fdopen on the raw file handles?

>  If the child process is a python script, one execute it
> with the -u option, which causes the script to run unbuffered. Sadly,
> that doesn't help since my child process is no python script. Also, in
> 2.3 you don't have access to the excellent subprocess module
> introduced in 2.4...

Sure you do.  It was included as a STANDARD module in 2.4, but it is
available for 2.3 and 2.2 from its author:

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

More information about the Python-win32 mailing list