secondlife / secondlife/python-llbase
Update llbase JSON logging for Python 3.13 compatibility
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 2
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
描述
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:
llbase/lljsonlog.py
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.- The module still carries Python 2 compatibility code, which may make the Python 3.13 update harder to reason about.
Expected outcome:
llbase.lljsonlog.JsonFormattershould 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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 llbase/lljsonlog.py 开始,然后检查模块级别的 cgitb import、_fmt_exc_cgitb(),以及 JsonFormatter 的默认 formatter 路径和 cgitb formatter 路径。检查现有的测试布局,确认对 import 和基本格式化行为的覆盖情况。完成的标准是:模块可以在 Python 3.13 上导入,默认格式化仍然正常工作,并且 cgitb 选项已被安全替换或明确标记为已弃用。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100