Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Missing method tkinter.Image._register #100814

Closed
Labels
@TheLizzard

Description

@TheLizzard

Bug report

Whentkinter 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:

importtkinterroot=tkinter.Tk()tkinter.PhotoImage(height=print)

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 callsPhotoImage orBitmapImage with a callable keyword parameter. So the only difference is the error message.

Your environment

The issue isn't environment dependant.

  • CPython versions tested on: 3.10 but from the source code, it should be present in all 3.7+ versions of cpython.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp