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

Appearance settings

tkinter: The deprecated trace variable command was removed from Tk 9.0 - tkinter still uses it.  #127802

Copy link
Copy link
Open
@culler

Description

@culler
Issue body actions

Bug report

Bug description:

The file tkinter/__init__.py contains the following code:

    def trace_variable(self, mode, callback):
        """Define a trace callback for the variable.

        MODE is one of "r", "w", "u" for read, write, undefine.
        CALLBACK must be a function which is called when
        the variable is read, written or undefined.

        Return the name of the callback.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_add() instead.
        """
        # TODO: Add deprecation warning

    trace = trace_variable

The deprecated Tcl method was removed from Tcl 9.0, before the deprecation warning was added in tkinter. The trace_variable() and trace() methods still exist in both the current tkinter/__init__.py and the replacement which was included in PR #124112. Calling those methods with Tk 9.0 raises a TclError.

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.