Skip to content

IDLE: Handle bad highlight tab color config #85604

Open

Description

@terryjreedy
BPO 41432
Nosy @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/terryjreedy'
closed_at = None
created_at = <Date 2020-07-29.03:33:23.391>
labels = ['expert-IDLE', 'type-bug', '3.10']
title = 'IDLE: Handle bad highlight tab color config'
updated_at = <Date 2020-07-29.03:33:23.391>
user = 'https://github.com/terryjreedy'

bugs.python.org fields:

activity = <Date 2020-07-29.03:33:23.391>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2020-07-29.03:33:23.391>
creator = 'terry.reedy'
dependencies = []
files = []
hgrepos = []
issue_num = 41432
keywords = []
message_count = 1.0
messages = ['374558']
nosy_count = 1.0
nosy_names = ['terry.reedy']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue41432'
versions = ['Python 3.10']

Linked PRs

Activity

  1. terryjreedy commented on Jul 29, 2020

    @terryjreedy
    MemberAuthor

    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.

  2. self-assigned this
    on Jul 29, 2020
  3. self-assigned this
    on Jul 29, 2020
  4. transferred this issue fromon Apr 10, 2022
  5. serhiy-storchaka commented on Sep 16, 2026

    @serhiy-storchaka
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

topic-IDLEtype-bugAn unexpected behavior, bug, or error

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions