subprocess.Popen stalls

mk mrkafk at
Mon Jan 12 16:33:34 CET 2009

psaffrey at wrote:

> p = Popen(cmd, shell=True, bufsize=100, stdout=PIPE, stderr=PIPE)
> output =

Better use communicate() method:

standardoutputstr, standarderrorstr = subprocess.communicate(...)

Never had any problem with subprocesses when using subprocess module in 
this manner (well it's possible that standardoutputstr and/or 
standarderrorstr fill up the memory, you get the idea).


More information about the Python-list mailing list