traceback2
Backports of the traceback module
What it is and what it does
traceback2 is a backport of Python's standard traceback module designed to provide consistent exception formatting and manipulation across older Python versions (2.6–3.4). It allows code targeting legacy Python environments to use a unified traceback API rather than dealing with version-specific differences in the standard library.
The package has no runtime dependencies and installs cleanly, but it is no longer maintained. The repository was archived and the last release occurred in 2015. Modern Python versions include the traceback functionality natively, so this package is primarily useful only for projects that must support very old Python versions that are themselves no longer receiving security updates.
Use it for:
- Formatting exception tracebacks consistently in code that must run on Python 2.6 or 2.7.
- Manipulating exception frames in legacy Python 3.2–3.4 environments where the standard library traceback API differs.
- Providing unicode traceback output in Python 2.x applications that depend on linecache2.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a backport of Python's traceback module to older Python versions, allowing consistent traceback formatting and manipulation across Python 2.6+ and Python 3.2+.
No. The package is abandoned and unmaintained since 2015. Modern Python versions include native traceback support. Install only if you are maintaining legacy code that must run on Python 2.6–3.4 and cannot upgrade—otherwise, use the standard library traceback module.
Install
traceback2 on PyPI
pip
pip install traceback2uv
uv add traceback2poetry
poetry add traceback2Installing traceback2
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 2015-03-09 and the repository is archived. It has not been maintained for years, so it will not receive bug fixes or security updates.
License in practice
Licensed under the Python Software Foundation License (permissive), which poses no legal barrier to use in most projects.
Quickstart
pip install traceback2
import traceback2 as traceback
traceback.print_exc()
Designed for Python 2.6, 2.7, 3.2, 3.3, and 3.4; modern Python versions have native traceback support and do not need this backport.
Verify before relying
- Whether the unicode output behavior in Python 2.x (mentioned in the description) affects current use cases or is still relevant.
- Current compatibility with Python versions released after the package's last update in 2015.
Package facts
| License | UNKNOWN (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,176 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 1,531,411/month — #3,806 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: traceback2-1.4.0-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
django-utils-sixProvides a backport of Django 2.2's…
permissive · top 15,000 on PyPI
linecache2Provides a backport of Python's linecache…
permissive · top 5,000 on PyPI
unittest2Backports unittest features from Python 2.7 and…
permissive · top 5,000 on PyPI
futureProvides Python 3 syntax and semantics on…
permissive · top 1,000 on PyPI
HTMLParserProvides HTMLParser from Python 2.7 as a…
permissive · top 15,000 on PyPI
backports.csvProvides Python 3's csv module API for Python…
unclear · top 15,000 on PyPI
textwrap3Backports Python 3.6's textwrap module to…
permissive · top 5,000 on PyPI
unicodedata2Provides updated Unicode character data tables…
permissive · top 15,000 on PyPI
configparser2Backport of Python 3's configparser module to…
permissive · top 15,000 on PyPI
contextlib2contextlib2 backports the Python standard…
permissive · top 5,000 on PyPI