This package provides general-purpose exception classes and implementations for the Zope ecosystem, designed to extend Python's standard `traceback` module with additional context information. It facilitates annotating tracebacks with `__traceback_info__` for unstructured data or `__traceback_supplement__` for delayed, structured data. It is currently at version 6.0 and receives updates primarily driven by Python version support and significant ecosystem changes, maintaining an active but irregular release cadence.
Install & Compatibility
Where this runs
tested against v6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.059s · 19.9MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.1s · import 0.057s · 21MB
22MB installed
● package 22MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from zope.exceptions import format_exception
Used for advanced HTML-based traceback formatting.
from zope.exceptions.exceptionformatter import HTMLExceptionFormatter
Used for advanced plain-text traceback formatting.
from zope.exceptions.exceptionformatter import TextExceptionFormatter
This quickstart demonstrates how to use `__traceback_info__` to inject context into an exception's traceback. The `format_exception` function then processes this enriched information for output, making debugging easier.
import sys
from zope.exceptions import format_exception
def problematic_function(item_id):
__traceback_info__ = f"Processing item with ID: {item_id}" # Adds context to traceback
raise ValueError(f"Failed to process item {item_id}")
try:
problematic_function('XYZ-123')
except Exception:
exc_type, exc_value, exc_traceback = sys.exc_info()
formatted_traceback = format_exception(exc_type, exc_value, exc_traceback)
print("\n".join(formatted_traceback))
del exc_traceback # Avoid reference cycles
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.