I'm trying to start up a child process and get its output on Linux from Python using the subprocess module:
#!/usr/bin/python2.4
import subprocess
p = subprocess.Popen(['ls', '-l', '/etc'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
However, I experience some flakiness: sometimes, p.communicate() would throw
OSError: [Errno 10] No child processes
What can cause this exception? Is there any non-determinism or race condition here that can cause flakiness?