Vista + Rails 2.0 upgrade => subprocess hangs

Christian Heimes lists at cheimes.de
Wed Dec 12 21:01:54 EST 2007


Eric Promislow wrote:
> Here's a small Python program I use to grab the output from rake:
> 
> =====
> 
> from subprocess import Popen, PIPE
> 
> p = Popen(args='c:\\ruby\\bin\\ruby.exe c:\\ruby\\bin\\rake -T',
>           cwd=u'c:\\Users\\ericp\\testing\\file07',
>           shell=True,
>           stdin=None,
>           stderr=PIPE,
>           stdout=PIPE,
>           creationflags=0x8000000
>           );
> p.wait()
> data = p.stdout.read()
> print data

Your usage of wait() is dangerous. The code can block indefinitely when
the stdout or stderr buffer is full.

Christian




More information about the Python-list mailing list