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
- auto-dotenv - Automatically load .env files
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f4abc997dcfe9958207e62cbe3d25bbb82a9c0abd1d958eef96c5300fa4c80e
|
|
| MD5 |
e7f40eb57920fd035733a7ba4d6b690b
|
|
| BLAKE2b-256 |
e76ebee47cbc8f28f15807ac68993110e108f8a21c2796047815738eff980cca
|
File details
Details for the file auto_faulthandler-1.0.0-py3-none-any.whl.
File metadata
- Download URL: auto_faulthandler-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b31016a4ac8032cf08f822e53a9e2bd2ee8ffd087b7b7a6706a258905cb5550
|
|
| MD5 |
fea42c2d615cf2bc6d4d63918b0600fa
|
|
| BLAKE2b-256 |
724904190adbcf3dbb19e4163a8c97f29c6690b6bfee31c53b723c29fbd50409
|