New submission from Cheryl Sabella <chek...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue32857>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to