|
10 | 10 |
|
11 | 11 | This module contains functions to dump Python tracebacks explicitly, on a fault, |
12 | 12 | after a timeout, or on a user signal. Call :func:`faulthandler.enable` to |
13 | | -install fault handlers for the :const:`SIGSEGV`, :const:`SIGFPE`, |
14 | | -:const:`SIGABRT`, :const:`SIGBUS`, and :const:`SIGILL` signals. You can also |
| 13 | +install fault handlers for the :const:`~signal.SIGSEGV`, |
| 14 | +:const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`, and |
| 15 | +:const:`~signal.SIGILL` signals. You can also |
15 | 16 | enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` environment |
16 | 17 | variable or by using the :option:`-X` ``faulthandler`` command line option. |
17 | 18 |
|
18 | 19 | The fault handler is compatible with system fault handlers like Apport or the |
19 | 20 | Windows fault handler. The module uses an alternative stack for signal handlers |
20 | | -if the :c:func:`sigaltstack` function is available. This allows it to dump the |
| 21 | +if the :c:func:`!sigaltstack` function is available. This allows it to dump the |
21 | 22 | traceback even on a stack overflow. |
22 | 23 |
|
23 | 24 | The fault handler is called on catastrophic cases and therefore can only use |
@@ -70,8 +71,9 @@ Fault handler state |
70 | 71 |
|
71 | 72 | .. function:: enable(file=sys.stderr, all_threads=True) |
72 | 73 |
|
73 | | - Enable the fault handler: install handlers for the :const:`SIGSEGV`, |
74 | | - :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL` |
| 74 | + Enable the fault handler: install handlers for the :const:`~signal.SIGSEGV`, |
| 75 | + :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` |
| 76 | + and :const:`~signal.SIGILL` |
75 | 77 | signals to dump the Python traceback. If *all_threads* is ``True``, |
76 | 78 | produce tracebacks for every running thread. Otherwise, dump only the current |
77 | 79 | thread. |
@@ -106,8 +108,8 @@ Dumping the tracebacks after a timeout |
106 | 108 |
|
107 | 109 | Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or |
108 | 110 | every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, call |
109 | | - :c:func:`_exit` with status=1 after dumping the tracebacks. (Note |
110 | | - :c:func:`_exit` exits the process immediately, which means it doesn't do any |
| 111 | + :c:func:`!_exit` with status=1 after dumping the tracebacks. (Note |
| 112 | + :c:func:`!_exit` exits the process immediately, which means it doesn't do any |
111 | 113 | cleanup like flushing file buffers.) If the function is called twice, the new |
112 | 114 | call replaces previous parameters and resets the timeout. The timer has a |
113 | 115 | sub-second resolution. |
|
0 commit comments