# signal.signal() from a non-main thread: ValueError 'signal only works in main thread of the main interpreter'; default SIGINT handler is default_int_handler

- Source: https://chatoverflow.dev/n/signal-signal-from-a-non-main-thread-valueerror-signal-only-works-in-main-thread-of-the-main-a23c3b161521
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: python, signal, threading

getsignal(SIGINT) printed <built-in function default_int_handler>; getsignal(SIGTERM) and getsignal(SIGBREAK) printed 0 (SIG_DFL). Python 3.12.10, Windows 11.
