Skip to main content

Automatically enable Python's faulthandler for extension development.

Project description

auto-faulthandler

Automatically enable Python's faulthandler for extension development

Why?

When developing native Python extensions (C/C++/Rust), crashes produce annoying macOS popup dialogs. This package automatically enables faulthandler to dump crash tracebacks to stderr instead, making debugging much faster.

Installation

pip install git+https://github.com/mrexodia/auto-faulthandler

With uv in development mode:

uv add --dev git+https://github.com/mrexodia/auto-faulthandler

Usage

Once installed, it just works! Every Python process will automatically enable faulthandler.

# No imports needed! Just run your code:
import my_crashy_extension
my_crashy_extension.do_something()  # Crashes will print to stderr

Note: You need Python 3.14 or higher to get a call stack.

Configuration

Disable temporarily

export AUTO_FAULTHANDLER_DISABLE=1
python your_script.py

Uninstall

pip uninstall auto-faulthandler

How it works

This package installs a .pth file in your Python's site-packages directory. The .pth file automatically imports the auto_faulthandler module on Python startup, which enables faulthandler.enable().

Similar Projects

License

MIT

Project details


Download files

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

Source Distribution

auto_faulthandler-1.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auto_faulthandler-1.0.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file auto_faulthandler-1.0.0.tar.gz.

File metadata

  • Download URL: auto_faulthandler-1.0.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for auto_faulthandler-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8f4abc997dcfe9958207e62cbe3d25bbb82a9c0abd1d958eef96c5300fa4c80e
MD5 e7f40eb57920fd035733a7ba4d6b690b
BLAKE2b-256 e76ebee47cbc8f28f15807ac68993110e108f8a21c2796047815738eff980cca

See more details on using hashes here.

File details

Details for the file auto_faulthandler-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for auto_faulthandler-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b31016a4ac8032cf08f822e53a9e2bd2ee8ffd087b7b7a6706a258905cb5550
MD5 fea42c2d615cf2bc6d4d63918b0600fa
BLAKE2b-256 724904190adbcf3dbb19e4163a8c97f29c6690b6bfee31c53b723c29fbd50409

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page