Re: subprocess hangs on reading stdout

2009-10-15 Thread Tim Arnold
"Minesh Patel" wrote in message news:mailman.1408.1255583431.2807.python-l...@python.org... > > >> Any ideas? comments on code welcome also. > > Here's something that I would probably do, there may be better ways. > This only works on python2.6 for the terminate() method. > > > import signal > im

Re: subprocess hangs on reading stdout

2009-10-14 Thread Minesh Patel
> > Any ideas? comments on code welcome also. Here's something that I would probably do, there may be better ways. This only works on python2.6 for the terminate() method. import signal import subprocess def timeout_handler(signum, frame): print "About to kill process" p.terminate() fo

subprocess hangs on reading stdout

2009-10-14 Thread Tim Arnold
Hi, I'm querying a list of network servers for processes belonging to a specific user. The problem is that when I try to read the stdout from the subprocess it sometimes hangs. Not always though. I thought maybe I needed to set unbufferered to true, so at the beginning of the code I set os.envi