Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Display the Python traceback on a crash

Project Description

Fault handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals: display the Python traceback and restore the previous handler. Allocate an alternate stack for this handler, if sigaltstack() is available, to be able to allocate memory on the stack, even on stack overflow (not available on Windows).

Import the module and call faulthandler.enable() to enable the fault handler.

Alternatively you can set the PYTHONFAULTHANDLER environment variable to a non-empty value.

The fault handler is called on catastrophic cases and so it can only use signal-safe functions (eg. it doesn’t allocate memory on the heap). That’s why the traceback is limited: it only supports ASCII encoding (use the backslashreplace error handler for non-ASCII characters) and limits each string to 100 characters, doesn’t print the source code in the traceback (only the filename, the function name and the line number), is limited to 100 frames and 100 threads.

By default, the Python traceback is written to the standard error stream. Start your graphical applications in a terminal and run your server in foreground to see the traceback, or pass a file to faulthandler.enable().

faulthandler is implemented in C using signal handlers to be able to dump a traceback on a crash or when Python is blocked (eg. deadlock).

This module is the backport for CPython 2.7. faulthandler is part of CPython standard library since CPython 3.3: faulthandler. For PyPy, faulthandler is builtin since PyPy 5.5: use pypy -X faulthandler.

Website: https://faulthandler.readthedocs.io/

Release History

Release History

This version
History Node

3.0

History Node

2.6

History Node

2.5

History Node

2.4

History Node

2.3

History Node

2.2

History Node

2.1

History Node

2.0

History Node

1.5

History Node

1.4

History Node

1.3

History Node

1.1

History Node

1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
faulthandler-3.0-cp27-cp27m-win32.whl (11.9 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Sep 15, 2017
faulthandler-3.0-cp27-cp27m-win_amd64.whl (12.5 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Sep 15, 2017
faulthandler-3.0.tar.gz (55.6 kB) Copy SHA256 Checksum SHA256 Source Sep 15, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting