STINNER Victor added the comment: Sending SIGTERM (CTRL+c, KeyboardInterrupt) while Python is waiting in threading.Thread.join() is not supported.
You have a thread running time.sleep(1). On Linux, this function calls the select() syscall. So you have the main thread waiting for the thread state lock, and a thread waiting in select(). If SIGTERM is received in the main thread, you enter a weird state of the threading module. Python has a signal.pthread_kill() which might help to only send a signal to a specific thread, but I don't know exactly how Python behaves, since Python wants to execute Python signal handles in the main thread... ---------- nosy: +haypo _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29309> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com