[issue31284] IDLE: Fix WindowList invalid command name error when running tests

Terry J. Reedy report at bugs.python.org
Sat Aug 26 18:56:35 EDT 2017


Terry J. Reedy added the comment:

I don't remember ever seeing that message.  Do you have code that reliably reproduces the problem?

    def postwindowsmenu(self):
        # Only called when Windows menu exists
        menu = self.menudict['windows']
        end = menu.index("end")
        ...
        windows.add_windows_to_menu(menu)

".!menu.windows" is the tk Windows Menu name, generated by tkinter and saved in menudict.  The function claims that it is only called when the menu exists, but the error is that it does not exist, even though it is still in the dict.  This is a bug.  It must result from a bug either in IDLE or the test teardown code, or maybe both.  I would rather fix the bug than shoot the messenger ;-)

Side note: the callback handling strikes me as slightly crazy.  Creating a ListedTopLevel calls registry.add, which calls all the callbacks, each of which regenerates the menu.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31284>
_______________________________________


More information about the Python-bugs-list mailing list