This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Akuli, epaine, serhiy.storchaka, terry.reedy
Date 2021-07-17.02:25:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626488748.81.0.424229752461.issue44592@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-07-17 02:25:48terry.reedysetrecipients: + terry.reedy, serhiy.storchaka, Akuli, epaine
2021-07-17 02:25:48terry.reedysetmessageid: <1626488748.81.0.424229752461.issue44592@roundup.psfhosted.org>
2021-07-17 02:25:48terry.reedylinkissue44592 messages
2021-07-17 02:25:48terry.reedycreate