Message397681
Traceback (most recent call last):
File "C:\Programs\Python310\lib\tkinter\__init__.py", line 1921, in __call__
return self.func(*args)
File "C:\Programs\Python310\lib\tkinter\__init__.py", line 839, in callit
func(*args)
File "C:\Programs\Python310\lib\tkinter\__init__.py", line 783, in focus_get
return self._nametowidget(name)
File "C:\Programs\Python310\lib\tkinter\__init__.py", line 1536, in nametowidget
w = w.children[n]
KeyError: 'e'
Is catching KeyError in the following
try:
# Tcl sometimes returns extra windows, e.g. for
# menus; those need to be skipped
result.append(self._nametowidget(child))
except KeyError:
pass
really correct? It appears to skip things that *can* get focus by key or mouse action. But what choice is there?
Silently failing when asked to focus on something is even less obviously correct. For 'widget = root.focus_get' to assign None to widget is not obviously useful as it likely just delays the error. |
|
Date |
User |
Action |
Args |
2021-07-17 02:25:48 | terry.reedy | set | recipients:
+ terry.reedy, serhiy.storchaka, Akuli, epaine |
2021-07-17 02:25:48 | terry.reedy | set | messageid: <1626488748.81.0.424229752461.issue44592@roundup.psfhosted.org> |
2021-07-17 02:25:48 | terry.reedy | link | issue44592 messages |
2021-07-17 02:25:48 | terry.reedy | create | |
|