Subprocess freezes when piping from stdout.

James McGill plexer at gmail.com
Sun Sep 7 23:25:38 EDT 2008


Hi All,

I'm using subprocess.Popen to run a C++ compiler and have set stdout =
PIPE. The exact line of code that I am using is:

process = Popen(command, stdout=PIPE)
status = process.wait()

This works fine until a large amount of data is written to stdout.
When this occurs, my python program seems to freeze. It will no longer
run or respond to Ctrl-C. I am assuming that it is stuck waiting for
the process to end, but I'm not sure why this should take so long (I
have left it running for hours and it never ended)

At the moment the code is being executed on a Win32 environment.

Is anyone aware of why this might be occurring, or of any ways around
this? Does the PIPE implementation in Win32 have a maximum buffer
size?

Regards,
James McGill



More information about the Python-list mailing list