[New-bugs-announce] [issue32857] tkinter after_cancel does not behave correctly when called with id=None

Cheryl Sabella report at bugs.python.org
Fri Feb 16 08:20:14 EST 2018


New submission from Cheryl Sabella <chekat2 at gmail.com>:

This was discovered while working on issue32839.  An old comment added for issue763637 resulted in further research and it was determined that the comment:

!             data = self.tk.call('after', 'info', id)
!             # In Tk 8.3, splitlist returns: (script, type)
!             # In Tk 8.4, splitlist returns: (script,)

wasn't correct.  The underlying difference is that the call to 'after info' returns different results depending on the way it's called.  If it's called with an 'id', it will return a tuple of (script, type) if the id is valid or a TclError if the id isn't valid.  However, if id is None, then 'after info' returns a tuple of all the event ids for the widget.  In the case of the original bug in issue763637, the reported message shows the return value of `('after#53',)`, which is definitely an after event id and not a (script,) tuple.

Serhiy mentions on issue32839 that the current code also deletes the script for the first event if after_cancel is called with None.
https://bugs.python.org/issue32839#msg312199

----------
components: Tkinter
messages: 312231
nosy: csabella
priority: normal
severity: normal
status: open
title: tkinter after_cancel does not behave correctly when called with id=None
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32857>
_______________________________________


More information about the New-bugs-announce mailing list