Update llbase JSON logging for Python 3.13 compatibility
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Empieza con llbase/lljsonlog.py y, a continuación, inspecciona el import de cgitb a nivel de módulo, _fmt_exc_cgitb() y las rutas del formatter predeterminado y del formatter cgitb de JsonFormatter. Comprueba el diseño de tests existente para verificar la cobertura del import y del comportamiento básico de formateo. La tarea estará terminada cuando el módulo se pueda importar en Python 3.13, el formateo predeterminado siga funcionando y la opción cgitb se sustituya de forma segura o se marque claramente como obsoleta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 2
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
essnmx good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
[Feature] 奇物选择添加优先级 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
syfoud/Simulated_Scepter#174 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Giskard-AI/giskard-oss#2840 · 1 comentario ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Abiertoarea: repo bug perceived difficulty: 2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yeti-platform/yeti#1380 ·