secondlife / secondlife/python-llbase

Update llbase JSON logging for Python 3.13 compatibility

Aperta
#21 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
2
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con llbase/lljsonlog.py, quindi esamina l’import di cgitb a livello di modulo, _fmt_exc_cgitb() e i percorsi del formatter predefinito e del formatter cgitb di JsonFormatter. Controlla la struttura dei test esistente per la copertura dell’import e del comportamento di formattazione di base. Il lavoro è completato quando il modulo può essere importato su Python 3.13, la formattazione predefinita continua a funzionare e l’opzione cgitb viene sostituita in modo sicuro o chiaramente contrassegnata come deprecata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.