-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
In signal.h for many windows distributions, macro definitions along the line of the following are seen.
#define SIGINT 2 /* Interactive attention */
#define SIGILL 4 /* Illegal instruction */
#define SIGFPE 8 /* Floating point error */
#define SIGSEGV 11 /* Segmentation violation */
#define SIGTERM 15 /* Termination request */
#define SIGBREAK 21 /* Control-break */
#define SIGABRT 22 /* Abnormal termination (abort) */Verification:
> python
Python 3.14.0 (tags/v3.14.0:ebf955d, Oct 7 2025, 10:15:03) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> for sig in __import__('signal').valid_signals(): print(f'{sig.name}: {sig.value}')
SIGINT: 2
SIGILL: 4
SIGFPE: 8
SIGSEGV: 11
SIGTERM: 15
SIGBREAK: 21
SIGABRT: 22Note the discrepancy: Windows has much less signals (which typeshed takes into account using conditional annotations), but on other systems, the value of SIGABRT is 6, and 22 is allocated to SIGTTOU.
Herein lies the issue. In the signal stub:
class Signals(IntEnum):
SIGABRT = 6 # HERE
SIGFPE = 8There is no conditional handling for windows, unlike below:
if sys.platform == "win32": # HERE
SIGBREAK = 21
CTRL_C_EVENT = 0
CTRL_BREAK_EVENT = 1
else:
SIGALRM = 14
SIGBUS = 7This is easily fixable. I will open a PR to fix it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels