faulthandler.dump_traceback_later(timeout, repeat=False, file=sys.stderr, exit=False)
Dump the tracebacks of all threads, after a timeout of timeout seconds, or every timeout seconds if repeat is True
. If exit is True
, call _exit()
with status=1 after dumping the tracebacks. (Note _exit()
exits the process immediately, which means it doesn’t do any cleanup like flushing file buffers.) If the function is called twice, the new call replaces previous parameters and resets the timeout. The timer has a sub-second resolution.
The file must be kept open until the traceback is dumped or cancel_dump_traceback_later()
is called: see issue with file descriptors.
This function is implemented using a watchdog thread and therefore is not available if Python is compiled with threads disabled.
Changed in version 3.5: Added support for passing file descriptor to this function.
Please login to continue.