faulthandler.register()
faulthandler.register() is a Python function in the Faulthandler Module category. Registers a handler for a fatal signal. The syntax is faulthandler.register(signal, file=sys.stderr, all_threads=True, chain=False). Returns: None. A typical example: faulthandler.register(signal.SIGUSR1) # Dump traceback on SIGUSR1. A close sibling is faulthandler.enable(), which enables the fault handler for crashes (segfaults, etc.). Dumps tracebacks on fatal signals. A close sibling is faulthandler.disable(), which disables the fault handler. A close sibling is faulthandler.dump_traceback(), which dumps tracebacks of all threads (like during a crash). More about this category: Fault handler for crashes — enable, disable, dump_traceback, register. Related Faulthandler Module entries: faulthandler.enable(), faulthandler.disable(), faulthandler.dump_traceback(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try faulthandler.register() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.