secondlife / secondlife/python-llbase

Update llbase JSON logging for Python 3.13 compatibility

Abierto
#21 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
2
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

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 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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

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.

Evaluación

Stack tecnológico
python
Área
tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
68/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.