faulthandler.enable()
faulthandler.enable() is a Python function in the Faulthandler Module category. Enables the fault handler for crashes (segfaults, etc.). Dumps tracebacks on fatal signals. The syntax is faulthandler.enable(file=sys.stderr, all_threads=True). Returns: None. A typical example: import faulthandler
faulthandler.enable() # Python will dump traceback on crash. 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). A close sibling is faulthandler.register(), which registers a handler for a fatal signal. More about this category: Fault handler for crashes — enable, disable, dump_traceback, register. Related Faulthandler Module entries: faulthandler.disable(), faulthandler.dump_traceback(), faulthandler.register(). 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.enable() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.