[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-05-08 Thread Alexander Overvoorde
Alexander Overvoorde added the comment: I understand that it's not a perfect solution, but at least it's a little bit closer. Thanks for your patch :) -- ___ Python tracker <https://bugs.python.o

[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-05-08 Thread Alexander Overvoorde
Alexander Overvoorde added the comment: I'm not sure that it is expected since Popen.send_signal does contain the following check: ``` def send_signal(self, sig): """Send a signal to the process.""" # Skip signalling a process that we know has alre

[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-05-07 Thread Alexander Overvoorde
New submission from Alexander Overvoorde : The following program frequently raises a ProcessLookupError exception when calling proc.terminate(): ``` import threading import subprocess import multiprocessing proc = subprocess.Popen(["sh", "-c", "exit 0"]) q