[Python-Dev] Removing PID check from signal handler

Steve Dower steve.dower at python.org
Fri Apr 12 14:05:03 EDT 2019

On 12Apr.2019 0919, Jeroen Demeyer wrote:
> The signal handler (that receives signals from the OS) in Python starts
> with a check
>     if (getpid() == main_pid)
> Looking at the comments, the intent was to do a check for the main
> *thread* but this is checking the *process* id. So this condition is
> basically always true. Therefore, I suggest to remove it in
> https://bugs.python.org/issue36601
> If you have any objections or comments, I suggest to post them to that bpo.

To add a little more context, the check was added about 25 years ago as
a "hack" for some reason that we can't figure out anymore.

So if you are a historian of ancient operating systems and know of one
that might have raised signal handlers in a different process from the
one where it was registered, we'd love to hear from you.


More information about the Python-Dev mailing list