This was causing a deadlock if there was a sufficient amount of console output. See also http://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait