Author gregcouch
Recipients gregcouch
Date 2009-06-11.21:09:37
SpamBayes Score 1.74059e-06
Marked as misclassified No
Message-id <1244754580.13.0.801057820447.issue6270@psf.upfronthosting.co.za>
In-reply-to
Content
Sometime around Python 2.5.4, Menu.delete was changed to delete
associated entry commands (and thus plug a memory leak).  This broke
Pmw.OptionMenu because it already had similar code, so when Menu.delete
was called, the commands were already gone, and a TclError was raised
saying "can't delete Tcl command".

While Pmw could be patched to workaround this bug, it seems strange that
Tkinter.Misc.deletecommand unconditionally deletes commands it knows
nothing about.  All uses of deletecommand in Tkinter refer to commands
that were Tkinter.Misc._register'ed, so they should appear in the
widget._tclCommands list.  So the proper solution is to only delete
commands that are still registered with the widget.

Repeat by:

import Pmw
om = Pmw.OptionMenu()
om.pack()
om.setitems(['a', 'b'])
om.setitems(['b'])
History
Date User Action Args
2009-06-11 21:09:40gregcouchsetrecipients: + gregcouch
2009-06-11 21:09:40gregcouchsetmessageid: <1244754580.13.0.801057820447.issue6270@psf.upfronthosting.co.za>
2009-06-11 21:09:39gregcouchlinkissue6270 messages
2009-06-11 21:09:38gregcouchcreate