Kenneth McDonald wrote:
The subprocess module has already an API method for your use case. The
communicate() method of a subprocess.Pope n instance takes an optional
stdin string and returns the stdout and stderr output as strings. The
method uses the best low level functions possible (select() on Unix,
threads on Windows).
Christian
When making calls of the form Popen(cmd, shell=True,
stdout=subproce ss.PIPE), we've been getting occasional, predictable
hangs. Will Popen accumulate a certain amount of stdout and then block
until its read? We don't want to use threads, so just want to read the
entire stdout after the subprocess has finished.
stdout=subproce ss.PIPE), we've been getting occasional, predictable
hangs. Will Popen accumulate a certain amount of stdout and then block
until its read? We don't want to use threads, so just want to read the
entire stdout after the subprocess has finished.
communicate() method of a subprocess.Pope n instance takes an optional
stdin string and returns the stdout and stderr output as strings. The
method uses the best low level functions possible (select() on Unix,
threads on Windows).
Christian