[issue41432] IDLE: Handle bad highlight tab color config

Terry J. Reedy report at bugs.python.org
Tue Jul 28 23:33:23 EDT 2020


New submission from Terry J. Reedy <tjreedy at udel.edu>:

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 "#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 "#00224"

Proposal 2: wrap line in try-except, if error text matches, extract bad color, replace any occurrence of bad color with "#000000" (black) or "#FFFFFF" (white), report to user with suggestion to edit.  Maybe save first.  Should do within loop in case more errors.

----------
assignee: terry.reedy
components: IDLE
messages: 374558
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Handle bad highlight tab color config
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41432>
_______________________________________


More information about the Python-bugs-list mailing list