Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-31485: Fix Misc.unbind behaviour when funcid is given #17954
Conversation
This comment has been minimized.
This comment has been minimized.
the-knights-who-say-ni
commented
Jan 11, 2020
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
About the ubuntu test failure: it happens at |
I think a new test is needed to verify that the revision does what we want and expect it to. |
self.tk.call('bind', self._w, sequence, '') | ||
"""Unbind for this widget the event SEQUENCE. if | ||
FUNCID is given, delete the command also.""" | ||
bound = '' | ||
if funcid: | ||
self.deletecommand(funcid) |
This comment has been minimized.
This comment has been minimized.
terryjreedy
Jan 14, 2020
•
Member
The test failure is here, _tkinter.TclError: can't delete Tcl command
. In the absence of more specific information, I interpret this as tk, on Linux, refusing to delete a command that is in use. Try moving the deletion back to after the rebinding, as it originally was. It is OK to have two if funcid
clauses.
This comment has been minimized.
This comment has been minimized.
GiovaLomba
Jan 14, 2020
•
Author
Should this work? I've just given it a try on Ubuntu and tests worked.
def unbind(self, sequence, funcid=None):
"""Unbind for this widget the event SEQUENCE. if
FUNCID is given, delete the command also."""
funcs = self.tk.call('bind', self._w, sequence, None)
self.tk.call('bind', self._w, sequence, '')
if funcid:
self.deletecommand(funcid)
keep = '\n'.join(f for f in funcs.split('\n') if not f.startswith(f'if {{"[{funcid}'))
self.tk.call('bind', self._w, sequence, keep)
Where should the test be written? Would the test just check that after unbind
with given funcid
, other bound function are there and the given one is gone?
Misc/NEWS.d/next/Library/2020-01-11-22-09-29.bpo-31485.DSvjsY.rst
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 14, 2020
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
GiovaLomba commentedJan 11, 2020
•
edited by bedevere-bot
https://bugs.python.org/issue31485