[Python-checkins] cpython (3.4): Issue #12209: Minor edits to faulthandler doc. Patch written by Éric Araujo.

victor.stinner python-checkins at python.org
Tue Mar 25 12:35:39 CET 2014


http://hg.python.org/cpython/rev/a97dcdee35f9
changeset:   89971:a97dcdee35f9
branch:      3.4
parent:      89969:2d953924979c
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Mar 25 12:33:56 2014 +0100
summary:
  Issue #12209: Minor edits to faulthandler doc. Patch written by Éric Araujo.

files:
  Doc/library/faulthandler.rst |  28 ++++++++++++++---------
  1 files changed, 17 insertions(+), 11 deletions(-)


diff --git a/Doc/library/faulthandler.rst b/Doc/library/faulthandler.rst
--- a/Doc/library/faulthandler.rst
+++ b/Doc/library/faulthandler.rst
@@ -11,7 +11,7 @@
 install fault handlers for the :const:`SIGSEGV`, :const:`SIGFPE`,
 :const:`SIGABRT`, :const:`SIGBUS`, and :const:`SIGILL` signals. You can also
 enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` environment
-variable or by using :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
 Windows fault handler. The module uses an alternative stack for signal handlers
@@ -39,8 +39,8 @@
 Python is deadlocked.
 
 
-Dump the traceback
-------------------
+Dumping the traceback
+---------------------
 
 .. function:: dump_traceback(file=sys.stderr, all_threads=True)
 
@@ -69,8 +69,8 @@
    Check if the fault handler is enabled.
 
 
-Dump the tracebacks after a timeout
------------------------------------
+Dumping the tracebacks after a timeout
+--------------------------------------
 
 .. function:: dump_traceback_later(timeout, repeat=False, file=sys.stderr, exit=False)
 
@@ -90,8 +90,8 @@
    Cancel the last call to :func:`dump_traceback_later`.
 
 
-Dump the traceback on a user signal
------------------------------------
+Dumping the traceback on a user signal
+--------------------------------------
 
 .. function:: register(signum, file=sys.stderr, all_threads=True, chain=False)
 
@@ -110,8 +110,8 @@
    Not available on Windows.
 
 
-File descriptor issue
----------------------
+Issue with file descriptors
+---------------------------
 
 :func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the
 file descriptor of their *file* argument. If the file is closed and its file
@@ -123,9 +123,15 @@
 Example
 -------
 
-Example of a segmentation fault on Linux: ::
+.. highlight:: sh
 
-    $ python -q -X faulthandler
+Example of a segmentation fault on Linux with and without enabling the fault
+handler::
+
+    $ python3 -c "import ctypes; ctypes.string_at(0)"
+    Segmentation fault
+
+    $ python3 -q -X faulthandler
     >>> import ctypes
     >>> ctypes.string_at(0)
     Fatal Python error: Segmentation fault

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list