[Python-Dev] Python threads end up blocking signals in subprocesses

Jeff Epler jepler at unpythonic.net
Tue Dec 23 09:05:48 EST 2003

On Tue, Dec 23, 2003 at 10:01:58AM +0100, Martin v. Loewis wrote:
> I would be concerned that we bypass magic that the system vendor put
> into system(), which is essential for proper operation. For example,
> on Linux, system() blocks SIGINT in the parent process while the
> child is running. Also, the shell executable that system() uses
> may not be /bin/sh.

This behavior (blocking SIGINT and SIGQUIT in the parent) is part of the
specification of system():
    The system() function shall ignore the SIGINT and SIGQUIT signals,
    and shall block the SIGCHLD signal, while waiting for the command to
    terminate. If this might cause the application to miss a signal that
    would have killed it, then the application should examine the return
    value from system() and take whatever action is appropriate to the
    application if the command terminated due to receipt of a signal.


More information about the Python-Dev mailing list