New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faulty override of tkinter.Misc.configure in tkinter.ttk.Scale.configure #83333
Comments
The issue arises by simply calling configure on the Scale widget of the themed tk (ttk) widgets set:
The above casues the following error:
The interpreter is:
|
I've modified the
It works as expected for my project, but I don't have regression tests or exahustive code checking in place to verify it behaves correctly for all use cases. How can we manage to perform those tests? |
Your code is buggy because 'cursor' is not a dict or anything like one. On the other hand, adding retval to capture and return the return from Widget.configure looks correct. (And it will not prevent kw.update('cursor') from raising. The current code is def configure(self, cnf=None, **kw):
"""Modify or query scale options.
) To review, test, and make the change, a github Pull Request (PR) is needed. I will make one. |
Giovanni, a Python exception is a intended exit. A crash is when the program either hangs or stops unintentionally without a python exception but with an OS error message. I checked and Scale is the only ttk widget that overrides configure. |
Hello Terry J. Reedy, first and foremost thanks for the time you've dedicated to this issue! I really appreciate you work!! Even if I work with Python since 2007, I'm new here, and not very well versed with this issue management system. This has been my first issue, hopefully not the last.. or maybe yes. Anyway, I'm going to clarify some points about your answers: 1: scale.configure('whateveroption') can take the name of an option and should return its value, usually a tuple (unless you've already customized the option's value) as all other widgets already do.
It there is some action I need to do, or some documentation I need to read in order to be able to help here please point me there. Thank you again. |
There is a special case in tests for Scale.configure. It should be removed now. And maybe there is an old issue for this? |
@serhiy.storchaka I didn't found any old issue not closed aboud tkinter Scale widget. |
Giovanni, I saw that you gave a correct fix even if your example was wrong. Currently, scale.configure returns None instead of the configuration. Your patch fixes this. Once I created a git branch to verify and test the fix, it was trivial to make a PR, so I did so. My PR still needs to patch the ttk.scale test. If you get an idea of what to do, before I do it, post on the PR if you have a github account, or here. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: