Danny Wong (dannwong) <dannw...@cisco.com> wrote: > cmd_output = subprocess.Popen(['scm', 'load', '--force', > '-r', nickname, '-d', directory, project], stdout=subprocess.PIPE, > stderr=subprocess.PIPE) > status = cmd_output.wait()
If you redirect stdout and/or stderr to a pipe, you must wait for EOF before calling wait(), otherwise you risk deadlock (the process blocks waiting for Python to read data from the pipe while Python is blocked waiting for the process to terminate). And if you redirect both stdout and stderr to pipes, you must either use multiple threads or non-blocking I/O, otherwise you risk deadlock (the process blocks waiting for Python to read data from one of the pipes while Python is blocked waiting for the process to write to the other pipe). I suggest looking at the .communicate() method of the Popen class. -- http://mail.python.org/mailman/listinfo/python-list