tblib
Traceback serialization library.
Decision gist · record as of 2026-08-14
Yes, if you need to pass exceptions across process boundaries. tblib is mature (Production/Stable since 2013), has no dependencies, and solves a real problem in multiprocessing, celery, and distributed systems. The aging maintenance is a minor concern but not a blocker—the code is stable and the repository is still active. Be aware that pickle support carries security responsibility, and tracebacks lose local variable information; for most distributed error handling, this is acceptable.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Pickle support is optional but comes with security responsibility—the documentation explicitly warns that you are solely responsible for security problems if you use pickle support.
- Low install friction with no runtime dependencies.
License · maintenance · safety
BSD-2-Clause (permissive) — BSD-2-Clause is permissive; you can use, modify, and distribute tblib with minimal restrictions, making it suitable for most commercial and open-source projects.
last release 2025-11-12 (275 days) · last repo commit 2025-11-12 · 184 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 32,800,766 downloads/mo, #771 on PyPI
Alternatives
Verify before relying
from tblib import pickling_support
import pickle, sys
pickling_support.install()
try:
1 / 0
except:
serialized = pickle.dumps(sys.exc_info())
exc_info = pickle.loads(serialized)
# exc_info now contains the exception, value, and traceback- Whether traceback objects retain sufficient detail for debugging in production scenarios beyond the documented 99% of use cases.
- Performance characteristics when serializing very large or deeply nested exception chains.
- Compatibility with third-party exception types that override __reduce__ or other pickling methods.
What it is and what it does
tblib is a serialization library that makes exception and traceback objects portable across process boundaries. It solves the problem that Python's standard pickle cannot serialize traceback objects, which breaks error handling in multiprocessing, celery, futures, and similar frameworks where exceptions need to be passed between processes. The library offers three approaches: optional pickle support (with a security caveat), string-based traceback reconstruction without pickling, and dict-based serialization for plain data interchange. It also handles Python 3's exception chaining (raise ... from ...) and preserves the full call stack so that re-raised exceptions show the original context.
The package has no runtime dependencies and installs as a pure Python wheel. It supports Python 3.9 through 3.14 on CPython and PyPy. Maintenance is aging but stable—the last release was 275 days ago, the repository is active, and the package has been in production use since 2013. The tradeoff is that pickled tracebacks are stripped of local variables to keep serialized size reasonable, which covers the documented use cases but may not suit scenarios requiring full variable inspection.
Use it for
- Capture an exception in a worker process (multiprocessing, celery, futures) and re-raise it with its original traceback in the parent process.
- Log or transmit exception details across a distributed system without losing stack context.
- Reconstruct a traceback from a string or dict representation for testing or post-mortem debugging.
- Serialize an exception chain (raise ... from ...) to disk or a message queue and restore it later.
- Decorate custom exception classes to ensure they pickle correctly in multi-process environments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to pass exceptions across process boundaries.
tblib is mature (Production/Stable since 2013), has no dependencies, and solves a real problem in multiprocessing, celery, and distributed systems. The aging maintenance is a minor concern but not a blocker—the code is stable and the repository is still active. Be aware that pickle support carries security responsibility, and tracebacks lose local variable information; for most distributed error handling, this is acceptable.
Install
tblib on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release 275 days ago—but the package is stable (Production/Stable status) and the repository remains active with recent commits.
Requires Python 3.9 or later. Pickle support is optional but comes with security responsibility—the documentation explicitly warns that you are solely responsible for security problems if you use pickle support.
License in practice
BSD-2-Clause is permissive; you can use, modify, and distribute tblib with minimal restrictions, making it suitable for most commercial and open-source projects.
Quickstart
from tblib import pickling_support
import pickle, sys
pickling_support.install()
try:
1 / 0
except:
serialized = pickle.dumps(sys.exc_info())
exc_info = pickle.loads(serialized)
# exc_info now contains the exception, value, and traceback
Verify before relying
- Whether traceback objects retain sufficient detail for debugging in production scenarios beyond the documented 99% of use cases.
- Performance characteristics when serializing very large or deeply nested exception chains.
- Compatibility with third-party exception types that override __reduce__ or other pickling methods.
Package facts
| License | BSD-2-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 275 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 32,800,766 / month, #771 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Utilities |
Evidence: tblib-3.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pickle tracebacks”
- tblibSerializes exceptions and tracebacks to pickle format or plain dicts,…
- ficklingFickling is a decompiler, static analyzer, and bytecode rewriter for…
- pickle5Backports the pickle 5 protocol (PEP 574) and related pickle module…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also zodbpickle · cloudpickle · stackprinter · dill · tracerite · traceback-with-variables · stack-data · exceptiongroup · pickle5 · renew