Wipeout 🌊
Savable/debuggable exceptions
Note: this project contains code taken from the awesome, but no longer maintained pydump
Motivation
Ever wish you could just jump into debugging an error that happened in production?
Wipeout will let you do that (with a few limitations at the moment)
It overrides the python system exception hook (the thing that happens when python crashes out due to an unhandled error) so that before exiting, a rerunnable traceback will be saved.
Wipeout also makes use of the great library fsspec so that you can save/load debug sessions to a variety of storage options (local, s3, azure blob, ssh, etc etc).
How to
Install
pip install wipeout
Use to store and load exceptions
Here's a simple example to save to a static file:
import wipeout
wipeout.install(lambda: "~/coolfile.wipeout")
After that, if the code hits an error, it'll save a debug session to that location, which can later be triggered with:
python -m wipeout.load --file ~/coolfile.wipeout
The above command will open up a postmortem session in your debugger of choice (based on your PYTHONBREAKPOINT environment variable) where your error happened.
You might want to include a date or something so that multiple errors don't overwrite each other.
from datetime import datetime
import wipeout
def filename_function():
date_string = datetime.now().strftime("%Y%m%d%H%S%f")
return f"~/cool_{date_string}.wipeout"
wipeout.install(filename_function)
And you can pass in storage options plus an fsspec prefix if you wanted to save in the cloud (see fsspec for more details):
from datetime import datetime
import wipeout
def filename_function():
date_string = datetime.now().strftime("%Y%m%d%H%S%f")
return f"abfs://someplace/cool_{date_string}.wipeout"
wipeout.install(filename_function, storage_options={"account_name": "blobstore", "anon": False})
Run mode
Wipeout also has a "run mode" which is a quick command to support running a python script as normal, but jumping into a debug session if an error is raised:
python -m wipeout.run rad/python/script.py
Metadata
Release files for wipeout 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wipeout-0.0.1.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wipeout-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.0 kB
Release files / wipeout-0.0.1.tar.gz
| Download URL | wipeout-0.0.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e16aca29ca579abc7db8b1baed6b9a4bf1340b8d984f602c56132d077c6c8ca
|
|
BLAKE2b-256 checksum How to use checksums |
4e09de34311937820597b74fefca9018598daf16e6cbb3e0eeec0e1c3a1862be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Release files / wipeout-0.0.1-py3-none-any.whl
| Download URL | wipeout-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b16406b0fbebaca63a12e2e7db6e3050b86a492447f015e1f165ada5f067dec
|
|
BLAKE2b-256 checksum How to use checksums |
c0500f92a5f395d335bbf8a6d3ad36a8abe829969038b8b3d673bd757a795547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|