This is the backtrace I get:
Traceback (most recent call last):
File "/home/anubis/test/multiprocessing-error.py", line 16, in <module>
proc.terminate()
File "/home/anubis/git/cpython/Lib/subprocess.py", line 2069, in terminate
self.send_signal(signal.SIGTERM)
File "/home/anubis/git/cpython/Lib/subprocess.py", line 2064, in send_signal
os.kill(self.pid, sig)
ProcessLookupError: [Errno 3] No such process
Is yours the same? This is expected, the process exited before proc.terminate().
You should wrap proc.terminate() in a try..except block:
try:
proc.terminate()
except ProcessLookupError:
pass
I am not sure we want to suppress this. |