Silent app exit: unhandled exceptions in callbacks / background threads are never logged (desktop 0.86.x)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 62/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend, documentation
Direzione di ricerca
Inizia dalla documentazione sulla gestione degli errori e dalla sezione del cookbook 1.0 su page.run_task() menzionata nell’issue. Controlla come quella documentazione descrive le eccezioni nei callback e nei thread in background, quindi documenta la configurazione supportata dell’hook globale oppure chiarisci il comportamento di Flet in questi casi. Il lavoro è completato quando la documentazione sulla gestione degli errori spiega cosa viene registrato e come gli utenti possono acquisire le eccezioni non gestite.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Split out of #7100 so it can be tracked independently.
Environment
- Flet 0.86.5, Python 3.14, Windows 11
- Packaged as a single desktop executable (no console attached)
- The app uses long-lived background workers and timer-driven UI updates
Observed behaviour
A packaged build occasionally exited with nothing shown to the user. The last
line in the application log was:
20:12:12 Session was garbage collected
followed by silence: no on_disconnect, no shutdown record, no traceback.
Try/except around individual event handlers did not capture the failure.
Diagnosis
The exception was raised in a Flet event callback or in a background thread,
outside the code path covered by the application's normal logging. With no
console attached, Python's default handling produced nothing useful.
Installing three hooks at startup made the next failure fully visible:
sys.excepthookthreading.excepthookasyncio.get_running_loop().set_exception_handler(...)
After that, the next crash produced a complete stack trace in the log. Without
those hooks the failure is effectively invisible, which makes it very hard to
file a useful bug report.
What would help
The 1.0 cookbook now documents that an un-awaited page.run_task() future logs
its exception through Flet. It does not say what happens to exceptions raised in
plain worker threads, or in a callback that is not a coroutine.
Could Flet either:
- log unhandled callback / thread exceptions to the console log by default in
desktop mode, or - document the recommended global-hook setup as the supported pattern?
A short note in the error-handling docs would already save a lot of blind
debugging. Optionally, emitting a pending-exception summary at session
garbage-collection time would make these silent exits reportable.
No project-specific data is included; the log line above is generic.
- Lingua principale
- Python
- Stelle
- 17.6k
- Fork
- 753
- Merge medio
- 2g 8h
- PR unite (30g)
- 64
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di flet-dev/flet
-
feature: python 3.15 supportApertafeature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
flet-dev/flet#6985 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug: dataclass_transform() uses should include `field_specifiers` argumentForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Desktop 0.86.x: silent callback crashes, ambiguous run_thread/run_task semantics, and focus() no-op via run_taskForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
bug: InputFilter number checkingForse già presa @ndonkoHenri l’ha presa oggi. Apertabug
flet-dev/flet#7098 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
feature request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di flet-dev/flet
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
mozilla-ai/cq#601 ·
I maintainer di solito rispondono entro 1 giorno
-
Bump Python to 3.14 or 3.15Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
intcomma returns exponential notation for large floatsForse già presa @Omarinho12345 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
python-humanize/humanize#521 ·
I maintainer di solito rispondono entro 1 giorno
-
LUCJ pass manager raises NoEdgeBetweenNodes when an edge is bad for two two-qubit gatesForse già presa @hat-im l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itForse già presa @paulo-0308 l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Diaoul/subliminal#1405 ·