Skip to content

Regular crashes within _styles_cache.py #5796

@GrizzlyFr

Description

@GrizzlyFr

I use Textual as an interface for running long industrial tests (e.g. two weeks span). At some seemingly random moments, my interface crashes.

It happens always in the same function of _styles_cache.py, for a missing "Y" key error. In my interface, I use a Log widget to display the INFO level logging entries (while all levels including INFO are put in a file). It seems that Textual crashes when writing a log entry to the Log widget.

I can't provide the code as it is linked to a physical test bench. But I did attached the exception trace and a screenshot of my interface.

I have no clue on how to fix it at least temporarily in order to complete my tests. Any suggestions ?

PS : Below the "textual diagnose", the screenshot and the trace:

Versions

Name Value
Textual 3.2.0
Rich 13.9.4

Python

Name Value
Version 3.10.12
Implementation CPython
Compiler GCC 11.4.0
Executable /home/user

/Documents/main_controller/venv/bin/python3 |

Operating System

Name Value
System Linux
Release 5.15.0-138-generic
Version #148-Ubuntu SMP Fri Mar 14 19:05:48 UTC 2025

Terminal

Name Value
Terminal Application Unknown
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=238, height=57
legacy_windows False
min_width 1
max_width 238
is_terminal True
encoding utf-8
max_height 57
justify None
overflow None
no_wrap False
highlight None
markup None
height None

Image

textual_crash_trace.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions