gh-101100: Fix Sphinx warnings in `library/faulthandler.rst` (#118353)

This commit is contained in:
Hugo van Kemenade 2024-04-28 21:06:45 +03:00 committed by GitHub
parent e0ab642436
commit 33c6cf3148
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 8 deletions

View File

@ -10,14 +10,15 @@
This module contains functions to dump Python tracebacks explicitly, on a fault, This module contains functions to dump Python tracebacks explicitly, on a fault,
after a timeout, or on a user signal. Call :func:`faulthandler.enable` to after a timeout, or on a user signal. Call :func:`faulthandler.enable` to
install fault handlers for the :const:`SIGSEGV`, :const:`SIGFPE`, install fault handlers for the :const:`~signal.SIGSEGV`,
:const:`SIGABRT`, :const:`SIGBUS`, and :const:`SIGILL` signals. You can also :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`, and
:const:`~signal.SIGILL` signals. You can also
enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` environment enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` environment
variable or by using the :option:`-X` ``faulthandler`` command line option. variable or by using the :option:`-X` ``faulthandler`` command line option.
The fault handler is compatible with system fault handlers like Apport or the The fault handler is compatible with system fault handlers like Apport or the
Windows fault handler. The module uses an alternative stack for signal handlers Windows fault handler. The module uses an alternative stack for signal handlers
if the :c:func:`sigaltstack` function is available. This allows it to dump the if the :c:func:`!sigaltstack` function is available. This allows it to dump the
traceback even on a stack overflow. traceback even on a stack overflow.
The fault handler is called on catastrophic cases and therefore can only use The fault handler is called on catastrophic cases and therefore can only use
@ -70,8 +71,9 @@ Fault handler state
.. function:: enable(file=sys.stderr, all_threads=True) .. function:: enable(file=sys.stderr, all_threads=True)
Enable the fault handler: install handlers for the :const:`SIGSEGV`, Enable the fault handler: install handlers for the :const:`~signal.SIGSEGV`,
:const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL` :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`
and :const:`~signal.SIGILL`
signals to dump the Python traceback. If *all_threads* is ``True``, signals to dump the Python traceback. If *all_threads* is ``True``,
produce tracebacks for every running thread. Otherwise, dump only the current produce tracebacks for every running thread. Otherwise, dump only the current
thread. thread.
@ -106,8 +108,8 @@ Dumping the tracebacks after a timeout
Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or 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 every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, call
:c:func:`_exit` with status=1 after dumping the tracebacks. (Note :c:func:`!_exit` with status=1 after dumping the tracebacks. (Note
:c:func:`_exit` exits the process immediately, which means it doesn't do any :c:func:`!_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 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 call replaces previous parameters and resets the timeout. The timer has a
sub-second resolution. sub-second resolution.

View File

@ -28,7 +28,6 @@ Doc/library/email.errors.rst
Doc/library/email.parser.rst Doc/library/email.parser.rst
Doc/library/email.policy.rst Doc/library/email.policy.rst
Doc/library/exceptions.rst Doc/library/exceptions.rst
Doc/library/faulthandler.rst
Doc/library/functools.rst Doc/library/functools.rst
Doc/library/http.cookiejar.rst Doc/library/http.cookiejar.rst
Doc/library/http.server.rst Doc/library/http.server.rst