Message 389143 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
I'd prefer to change os.kill() to take the code path that generates a console control event only when the pid value is negative (i.e. a process group ID), with -1 reserved to send the event to all processes in the console session (i.e. console process group 0). Also, in this case, I'd map SIGINT and SIGBREAK to CTRL_C_EVENT and CTRL_BREAK_EVENT, instead of directly using the Windows API constants. Such a design conforms better with POSIX kill() [1], and it cleanly separates the GenerateConsoleCtrlEvent() and TerminateProcess() usage.

The older usage with kill(non_negative_pid, console_control_event) could be retained by checking for the enum instances signal.CTRL_C_EVENT and signal.CTRL_BREAK_EVENT by object ID instead of by value.

---

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html