Message346191
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. |
|
Date |
User |
Action |
Args |
2019-06-21 08:17:47 | maggyero | set | recipients:
+ maggyero, tim.peters, paul.moore, pitrou, tim.golden, neologix, zach.ware, eryksun, steve.dower, pdgoins-work, gaborjbernat |
2019-06-21 08:17:47 | maggyero | set | messageid: <1561105067.47.0.151316961007.issue21822@roundup.psfhosted.org> |
2019-06-21 08:17:47 | maggyero | link | issue21822 messages |
2019-06-21 08:17:47 | maggyero | create | |
|