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
Missing method tkinter.Image._register #100814
Labels
Comments
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Aug 6, 2023
… option Passing a callable object as an option value to a Tkinter image now raises the expected TclError instead of an AttributeError.
serhiy-storchaka
added a commit
that referenced
this issue
Aug 7, 2023
…option (GH-107692) Passing a callable object as an option value to a Tkinter image now raises the expected TclError instead of an AttributeError.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Aug 7, 2023
…image option (pythonGH-107692) Passing a callable object as an option value to a Tkinter image now raises the expected TclError instead of an AttributeError. (cherry picked from commit 50e3cc9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Aug 7, 2023
…image option (pythonGH-107692) Passing a callable object as an option value to a Tkinter image now raises the expected TclError instead of an AttributeError. (cherry picked from commit 50e3cc9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Yhg1s
pushed a commit
that referenced
this issue
Aug 16, 2023
… image option (GH-107692) (#107722) gh-100814: Fix exception for invalid callable value of Tkinter image option (GH-107692) Passing a callable object as an option value to a Tkinter image now raises the expected TclError instead of an AttributeError. (cherry picked from commit 50e3cc9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
When
tkinter
get's a keyword argument, it tries to convert it to a string that tcl/tk can handle. The problem is that when a callable object is passed in as the value for a keyword argument,tkinter
usually calls an internal_register
method but it's missing from theImage
class. Here intkinter/__init__.py
,tkinter
tries to callself._register(v)
but there is no method named_register
in theImage
class. There is a_register
method forMisc
andVariable
butImage
doesn't inherit from any of those. A minimal reproducible example:The expected error is:
_tkinter.TclError: expected integer but got "140140827421696print"
but it's throwingAttributeError: 'PhotoImage' object has no attribute '_register'
.The only time this bug would appear is when someone makes a mistake and calls
PhotoImage
orBitmapImage
with a callable keyword parameter. So the only difference is the error message.Your environment
The issue isn't environment dependant.
Linked PRs
The text was updated successfully, but these errors were encountered: