Muneer Alam Work / safedump

The traceback ends. The questions don’t.

A Python exception names the failing line. safedump keeps the runtime context that helps explain it: bounded variable snapshots, exception chains and thread state, saved locally for inspection after the process stops.

safedump / contribution
Creator and maintainer, with community contributions preserved in the project history.
Timeline & status
June 2026 — ongoing
Published package
Built with
Python · JSON · Rich · GitHub Actions
Developer toolingBUILD NOTES / 2026
safedump / project preview
Actual safedump HTML report with a synthetic divide-by-zero example and a redacted fake API key
safedump↗
View full project screenshot ↗
Actual project capture from the public repository. Synthetic example; report contents still need review before sharing.

A Python traceback is a map back to the line that failed. It rarely answers the next question: what did the program look like when it got there?

That gap is where safedump lives. It saves a structured account of an exception on your own machine, so you can inspect the context after the process has stopped. The original traceback still has a job to do. The report gives you another way to investigate.

A tiny failure with a longer afterlife

Here is a deliberately small example:

import safedump

safedump.install()

price = 12.5
quantity = 0
unit_price = price / quantity

The exception is obvious. In a larger application, the useful part is being able to return to the frames, local values and exception chain without first reproducing exactly the same input. A report can be opened in the terminal, rendered as a self-contained HTML document, or inspected through the local browser viewer.

The screenshot above is the real HTML inspection interface. The capture and the interface are separate pieces of the product: one has to work while the application is failing; the other can take its time helping a person understand the result.

Keep the emergency path small

Inside the package, capture walks the exception chain and frames, builds bounded snapshots, sanitizes the data, serializes it and writes it to storage. Main-thread exceptions, worker-thread exceptions and unraisable exceptions have different hooks because Python does not send them all through the same entrance.

The capture library uses the standard library. Rich belongs to the optional viewer. Formatting a beautiful report is useful later; loading a presentation stack is less useful in the middle of a failure.

An exception is captured into a bounded, sanitized local report, then inspected separately in the terminal or HTML viewer.
Two different moments: preserve the evidence now; make it comfortable to read afterwards. Open the diagram ↗

Object snapshots need limits. Real objects can be recursive, unexpectedly large, or awkward to represent. The frame walker bounds what it records rather than trying to turn an entire running process into JSON. A stable fingerprint also gives repeated crashes a common identity instead of making every occurrence an unrelated file.

“Local” is a useful boundary, not a privacy guarantee

Variable values are precisely what make a report valuable. They can also be the sensitive part. safedump provides privacy tiers and redaction controls, but an exception message, source line or file path can still reveal information the filter cannot recognize.

Review a crash report before sharing it. Redaction reduces exposure; it does not establish that every possible secret is gone.

This is one place where the project’s documentation has become more careful as the implementation matured. A reassuring name should not replace a clear explanation of what is collected, what is removed and what remains the developer’s responsibility.

Learning the other side of open source

I also wanted to understand what happens on the maintainer’s side of a package. Using a library is one experience. Keeping its installation, compatibility, documentation, releases and contributions understandable is another.

codelines was a smaller introduction to that process. safedump gave the process a concrete use case and a more demanding contract: an error-reporting tool should not turn one failure into a more confusing one. Extension points such as before_capture and on_crash let applications participate without forcing every integration into the package itself.

The published Python package and its source are the result. The most interesting part of the work is how much engineering sits around a seemingly simple instruction: keep enough of the crash to make sense of it later.

Code & further reading

Written by Muneer Alam · Reviewed 1 November 2026