Issue 9127: subprocess.Popen.communicate() and SIGCHLD handlers (original) (raw)

Content of the above pastie:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import signal import subprocess signal.signal(signal.SIGCHLD,signal.SIG_IGN) 0 subprocess.Popen(["echo","blah"], stdout=subprocess.PIPE).communicate()[0] Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/subprocess.py", line 698, in communicate self.wait() File "/usr/lib/python2.6/subprocess.py", line 1170, in wait pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0) File "/usr/lib/python2.6/subprocess.py", line 465, in _eintr_retry_call return func(*args) OSError: [Errno 10] No child processes oldsignal = signal.signal(signal.SIGCHLD,signal.SIG_DFL) subprocess.Popen(["echo","blah"], stdout=subprocess.PIPE).communicate()[0] 'blah\n' signal.signal(signal.SIGCHLD,oldsignal) 0