Closed
Description
Bug report
Bug description:
on windows, Thread.join is sometimes terrible because exception can not interrupt its blocking.
import threading
import time
def task():
while True:
time.sleep(1)
t = threading.Thread(target=task)
t.start()
t.join()
you can't exit this program by Ctrl+C on windows.
we can easily fix it to let exceptions been raisen.
import threading
import time
def task():
while True:
time.sleep(1)
t = threading.Thread(target=task)
t.start()
while t.is_alive():
t.join(timeout=2)
this is what I want to fix in _python_exit, which been registered in atexit-call and it costs me a lot of time to realize what's problem with my program.
I'll send pr soon.
CPython versions tested on:
3.9, 3.10, 3.11, 3.12
Operating systems tested on:
Windows