[issue25942] subprocess.call SIGKILLs too liberally

Martin Panter report at bugs.python.org
Fri Jan 1 15:21:41 EST 2016


Martin Panter added the comment:

The reported problem is when no timeout is given. Perhaps it would be sufficient to:

1. Kill the child if any exception happens when a timeout is enforced
2. Never kill the child when there is no timeout

If a timeout is specified, the current code is good enough, but if no timeout is specified, maybe we should just do the equivalent of:

with Popen(...) as p:
    return p.wait()
    # If interrupted, the context manager will wait again. If the interruption is due to a terminal-wide SIGINT, the child may also have been interrupted.

For comparison, the Posix system() function is supposed to ignore SIGINT and SIGQUIT (i.e. signals from the terminal). See the Gnu implementation: <https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/system.c>.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25942>
_______________________________________


More information about the Python-bugs-list mailing list