Message 346191 - Python tracker (original) (raw)
I am having the same blocked signal issue on Windows when using Thread.join. This program does not print "interrupted" after pressing Ctrl+C:
import threading import time
def f(): while True: print("processing") time.sleep(1)
if name == "main": try: thread = threading.Thread(target=f) thread.start() thread.join() except KeyboardInterrupt: print("interrupted")
For reference, 2 years ago Nathaniel Smith gave an interesting explanation here: https://mail.python.org/pipermail/python-dev/2017-August/148800.html.