[issue37076] _thread.start_new_thread(): call sys.unraisablehook() to handle uncaught exceptions

Christoph Reiter report at bugs.python.org
Tue May 28 11:16:37 EDT 2019


Christoph Reiter <reiter.christoph at gmail.com> added the comment:

> _thread.start_new_thread() calls none of these hooks, but directly logs the exception.

It calls sys.excepthook() currently:

import _thread
import threading
import sys

done = False
def hook(*args):
    global done
    print(threading.current_thread())
    done = True
sys.excepthook = hook

def worker():
    raise Exception
_thread.start_new_thread(worker, tuple())
while not done:
    pass

----------
nosy: +lazka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37076>
_______________________________________


More information about the Python-bugs-list mailing list