subprocess.Popen instance hangs

T

Tim Johnson

using Python 2.7.1 on OS X 10.7.5

I'm managing a process of drush using an instance of subprocess.Popen

The process has a '--verbose' option. When that option is passed as
part of the initializer `args' argument, the process will hang.

It should be no surprise as drush output with the --verbose option
can be _extremely_ verbose, and I can do without it, but I would
like to learn how to handle it. I've googled this topic, but my poor
little brain is yet to sort out all of the content found.

## my relevant code follows :
p = subprocess.Popen(args,stderr=subprocess.STDOUT,stdout=subprocess.PIPE)
## wait() is 'forever' if '--verbose' used
exit_status = p.wait()
output = p.stdout.read()
## done

I 'suspect' that using a tempfile may be the solution, if so, I
could use some examples.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top