Skip to content

IDLE: ignore completion ValueError for list.remove() #89360

Closed

Description

@rhettinger
BPO 45197
Nosy @rhettinger, @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 2021-09-14.15:33:16.373>
labels = ['expert-IDLE', 'type-bug', '3.9']
title = 'IDLE should suppress ValueError for list.remove()'
updated_at = <Date 2021-09-15.03:00:13.699>
user = 'https://github.com/rhettinger'

bugs.python.org fields:

activity = <Date 2021-09-15.03:00:13.699>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2021-09-14.15:33:16.373>
creator = 'rhettinger'
dependencies = []
files = []
hgrepos = []
issue_num = 45197
keywords = []
message_count = 2.0
messages = ['401782', '401807']
nosy_count = 2.0
nosy_names = ['rhettinger', 'terry.reedy']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45197'
versions = ['Python 3.9']

Linked PRs

Activity

  1. rhettinger commented on Sep 14, 2021

    @rhettinger
    ContributorAuthor

    I got this today running a stock Python 3.9.6 for macOS downloaded from python.org.

    -------------------------------------------------------------

    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1892, in __call__
        return self.func(*args)
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/multicall.py", line 176, in handler
        r = l[i](event)
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 350, in keypress_event
        self.hide_window()
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 463, in hide_window
        self.widget.event_delete(HIDE_VIRTUAL_EVENT_NAME, seq)
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/multicall.py", line 392, in event_delete
        triplets.remove(triplet)
    ValueError: list.remove(x): x not in list
  2. terryjreedy commented on Sep 15, 2021

    @terryjreedy
    Member

    The offending function is

            def event_delete(self, virtual, *sequences):
                if virtual not in self.__eventinfo:
                    return
                func, triplets = self.__eventinfo[virtual]
                for seq in sequences:
                    triplet = _parse_sequence(seq)
                    if triplet is None:
                        #print("Tkinter event_delete: %s" % seq, file=sys.__stderr__)
                        widget.event_delete(self, virtual, seq)
                    else:
                        if func is not None:
                            self.__binders[triplet[1]].unbind(triplet, func)
                        triplets.remove(triplet)

    The triplets collection is part of *virtual* whereas each triplet is derived from a member of sequences.
    The discrepancy seems to be extremely rare. I will catch the exception until such time as I see a plausible, reproducible, and testable reason.

  3. transferred this issue fromon Apr 10, 2022
  4. changed the title [-]IDLE should suppress ValueError for list.remove()[/-] [+]IDLE: ignore completion ValueError for list.remove()[/+] on Aug 6, 2022
  5. added
    stdlibStandard Library Python modules in the Lib/ directory
    and removed on Oct 15, 2025
  6. removed
    stdlibStandard Library Python modules in the Lib/ directory
    on Jan 15, 2026
  7. added 4 commits that reference this issue on Jul 1, 2026
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