[issue45197] IDLE should suppress ValueError for list.remove()

2021-09-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45197] IDLE should suppress ValueError for list.remove()

2021-09-14 Thread Raymond Hettinger


New submission from Raymond Hettinger :

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

--
assignee: terry.reedy
components: IDLE
messages: 401782
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE should suppress ValueError for list.remove()
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com