secondlife / secondlife/python-llbase
Update llbase JSON logging for Python 3.13 compatibility
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với llbase/lljsonlog.py, sau đó kiểm tra import cgitb ở cấp module, _fmt_exc_cgitb() và các nhánh formatter mặc định và formatter cgitb của JsonFormatter. Kiểm tra bố cục test hiện có để xác định mức độ bao phủ của import và hành vi formatting cơ bản. Công việc được xem là hoàn tất khi module import được trên Python 3.13, formatting mặc định vẫn hoạt động và tùy chọn cgitb được thay thế an toàn hoặc được đánh dấu rõ ràng là đã deprecated.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100