You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDLE: Handle bad highlight tab color config #85604
File "C:\Users\...\idlelib\configdialog.py", line 1279, in paint_theme_sample
self.highlight_sample.tag_config(element, **colors)
...
_tkinter.TclError: invalid color name "bpo-00224"
Proposal 2: wrap line in try-except, if error text matches, extract bad color, replace any occurrence of bad color with "bpo-000000" (black) or "#FFFFFF" (white), report to user with suggestion to edit. Maybe save first. Should do within loop in case more errors.
The missing-element part of this issue was already fixed: GetThemeDict() substitutes default colors and warns. The remaining part, an invalid color string, still crashed the Settings dialog. #157620 checks the user themes at IDLE startup, warns about invalid colors and uses the default colors instead.
Activity
terryjreedy commentedon Jul 29, 2020
https://stackoverflow.com/questions/35397377/python-freezes-when-configuring-idle froze IDLE with a custom theme missing 'colours for the blinker and highlighting'. I reported some experiments there. Tracebacks might help, but
Proposal 1: check theme before try to paint. All keys present? Replace missing with normal colors.
https://stackoverflow.com/questions/63137659/idle-crashing-when-i-press-configure-idle froze IDLE with a custom theme with a bad color "bpo-00224".
File "C:\Users\...\idlelib\configdialog.py", line 1279, in paint_theme_sample
self.highlight_sample.tag_config(element, **colors)
...
_tkinter.TclError: invalid color name "bpo-00224"
Proposal 2: wrap line in try-except, if error text matches, extract bad color, replace any occurrence of bad color with "bpo-000000" (black) or "#FFFFFF" (white), report to user with suggestion to edit. Maybe save first. Should do within loop in case more errors.
serhiy-storchaka commentedon Sep 16, 2026
The missing-element part of this issue was already fixed:
GetThemeDict()substitutes default colors and warns. The remaining part, an invalid color string, still crashed the Settings dialog. #157620 checks the user themes at IDLE startup, warns about invalid colors and uses the default colors instead.