![]() So, this patch would kill only on a timeout, and never on another error like Ctrl-C, a UserDefinedTimeoutException from a signal handler, etc. If I understand correctly, the _try_wait mechanics (or 3.5's syscall behavior) already handle EINTR the way we way: ignore it and try wait()ing again. The code was introduced to solve issue 12494, so I'm adding Victor to weigh in. The fix is, I think, simply changing the clause to "except TimeoutExpired". The child will not be able to clean up appropriately. For practical purposes, this means that sending a Ctrl-C to a python program before 3.3 sent a SIGINT to both the parent and subprocess.call()d child, whereas under 3.3+ sends a SIGINT _and_ a SIGKILL to the child. However, the "except" clause is too broad, and will, for instance, trigger on a KeyboardInterrupt. Python 3.3 introduces timeout support in subprocess.call, implemented by sending a SIGKILL if the Popen.wait is interrupted by a TimeoutExpired exception. ![]() ![]() Patch to restrict subprocess.call SIGKILLs to timeouts only Subprocess-call-p圓44-kill-only-on-timeout.patch Mike Pomraning, SilentGhost, gregory.p.smith, martin.panter, rpcope1, stuarteberg, vstinnerĬreated on 01:15 by Mike Pomraning, last changed 14:58 by admin. Do not immediately SIGKILL subprocess child processes upon ^C
0 Comments
Leave a Reply. |