llbase.lljsonlog.JsonFormatter currently imports and supports cgitb for exception formatting. The cgitb module was removed in Python 3.13, so any code path that imports llbase.lljsonlog can fail or require local workarounds when running on Python 3.13.
We recently worked around this in the Join Django app by adding an internal JSON log formatter that is compatible with llbase.lljsonlog.JsonFormatter but does not import cgitb. That workaround keeps Join unblocked, but the underlying compatibility issue still exists in the shared python-llbase library.
Current library location:
Current problem areas:
import cgitb happens at module import time.
_fmt_exc_cgitb() depends on cgitb.Hook.
JsonFormatter(exception_formatter="cgitb") cannot be supported on Python 3.13 without a replacement implementation.
- The module still carries Python 2 compatibility code, which may make the Python 3.13 update harder to reason about.
Expected outcome:
llbase.lljsonlog.JsonFormatter should be importable on Python 3.13.
- The default traceback formatter should continue to work.
- Existing users of
JsonFormatter() should not need app-level replacements.
- If
exception_formatter="cgitb" is still needed, either provide a Python 3.13-safe replacement or clearly document/deprecate that option.
- Add or update tests covering import and basic formatting behavior on supported Python versions.
This should let Join remove its local compatibility formatter once the shared library has a Python 3.13-compatible release.
llbase.lljsonlog.JsonFormattercurrently imports and supportscgitbfor exception formatting. Thecgitbmodule was removed in Python 3.13, so any code path that importsllbase.lljsonlogcan fail or require local workarounds when running on Python 3.13.We recently worked around this in the Join Django app by adding an internal JSON log formatter that is compatible with
llbase.lljsonlog.JsonFormatterbut does not importcgitb. That workaround keeps Join unblocked, but the underlying compatibility issue still exists in the sharedpython-llbaselibrary.Current library location:
Current problem areas:
import cgitbhappens at module import time._fmt_exc_cgitb()depends oncgitb.Hook.JsonFormatter(exception_formatter="cgitb")cannot be supported on Python 3.13 without a replacement implementation.Expected outcome:
llbase.lljsonlog.JsonFormattershould be importable on Python 3.13.JsonFormatter()should not need app-level replacements.exception_formatter="cgitb"is still needed, either provide a Python 3.13-safe replacement or clearly document/deprecate that option.This should let Join remove its local compatibility formatter once the shared library has a Python 3.13-compatible release.