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 taleinat
Recipients kbk, roger.serwy, serhiy.storchaka, taleinat, terry.reedy
Date 2014-02-05.11:43:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391600618.2.0.0110312936043.issue20167@psf.upfronthosting.co.za>
In-reply-to
Content
I put the try/except outside of the loop on purpose. If calling the widget's unbind() method fails once, it will fail forever afterwards.

If you prefer a different spelling, move the try/except into the loop, and break out of the loop in case of an exception:

for seq, id in self.handlerids:
    try:
        self.widget.unbind(self.widgetinst, seq, id)
    except _tkinter.TclError:
        break


As for avoiding the exception in the first place, I'm sure figuring out how IDLE shuts down would be a lot of work, and I honestly don't think it's necessary. Note that this problem is triggered in a __del__() method; making sure these are called at a proper time is problematic because the timing depends on the GC.
History
Date User Action Args
2014-02-05 11:43:38taleinatsetrecipients: + taleinat, terry.reedy, kbk, roger.serwy, serhiy.storchaka
2014-02-05 11:43:38taleinatsetmessageid: <1391600618.2.0.0110312936043.issue20167@psf.upfronthosting.co.za>
2014-02-05 11:43:38taleinatlinkissue20167 messages
2014-02-05 11:43:38taleinatcreate