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 serhiy.storchaka
Recipients belopolsky, gpolo, gregcouch, jepler, serhiy.storchaka, terry.reedy
Date 2016-07-24.05:29:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469338160.64.0.122668946483.issue734176@psf.upfronthosting.co.za>
In-reply-to
Content
Issue18686 is reproducible to me. Here is a script based on issue18686 example. Run it and open the "File" menu.

$ python3 issue18686.py 
.#3069298188.#3069298188#3069298252
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1553, in __call__
    return self.func(*args)
  File "issue18686.py", line 24, in entry_focus_lost
    widget_with_focus = self.focus_get()
  File "/usr/lib/python3.5/tkinter/__init__.py", line 550, in focus_get
    return self._nametowidget(name)
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1204, in nametowidget
    w = w.children[n]
KeyError: '#3069298188'

But my patch doesn't help in case of tearoff menu. Detach the "File" menu and hover a mouse on its item.

$ ./python issue18686.py 
.#`menu.#`menu#`menu
.`menu.`menu
.tearoff1
Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 1712, in __call__
    return self.func(*args)
  File "issue18686.py", line 24, in entry_focus_lost
    widget_with_focus = self.focus_get()
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 692, in focus_get
    return self._nametowidget(name)
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 1344, in nametowidget
    w = w.children[n]
KeyError: 'tearoff1'
History
Date User Action Args
2016-07-24 05:29:20serhiy.storchakasetrecipients: + serhiy.storchaka, jepler, terry.reedy, belopolsky, gregcouch, gpolo
2016-07-24 05:29:20serhiy.storchakasetmessageid: <1469338160.64.0.122668946483.issue734176@psf.upfronthosting.co.za>
2016-07-24 05:29:20serhiy.storchakalinkissue734176 messages
2016-07-24 05:29:20serhiy.storchakacreate