secondlife / secondlife/python-llbase

Update llbase JSON logging for Python 3.13 compatibility

Offen
#21 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
2
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit llbase/lljsonlog.py und untersuche anschließend den cgitb-Import auf Modulebene, _fmt_exc_cgitb() sowie die Standard- und cgitb-Formatter-Pfade von JsonFormatter. Prüfe das bestehende Testlayout auf Abdeckung des Imports und des grundlegenden Formatierungsverhaltens. Die Aufgabe ist erledigt, wenn das Modul unter Python 3.13 importiert werden kann, die Standardformatierung weiterhin funktioniert und die cgitb-Option sicher ersetzt oder eindeutig als veraltet gekennzeichnet ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.