Skip to content

[Bug]: TkAgg leaves behind "zombie" window in IPython sessions with MacOS Tahoe #31114

@TheSkyentist

Description

@TheSkyentist

Bug summary

When investigating #31106 I was trying different backends to see if I could reproduce the behaviour in backends that are not MacOSX.

When testing the TkAgg backend I came across a similar issue. When trying to close the window (not a tab) the window stays open and cannot be interacted with. Hovering over the window prompts a "spinning wheel" (ergo a "zombie" window versus a "ghost" window as this window is not see-through). However unlike the bug in #31106, opening a new figure/window clears the old one.

However this only happens in an ipython session, not in a python interactive session.

I cannot verify if this is new as of MacOSX 26 since I was not using the TkAgg backend prior to this. Similarly I have not tried this on other OSes, so the two bugs could be coincidentally similar.

Code for reproduction

import matplotlib
matplotlib.rcdefaults()
matplotlib.use('TkAGG')
from matplotlib import pyplot
figure = pyplot.figure()
figure = pyplot.figure()
pyplot.show()

Actual outcome

TKAgg.mov

Expected outcome

Window should close.

Additional information

I also reproduce the bug with:

ipython     8.18.1   pyh707e725_3        577.19 KiB  conda  https://conda.anaconda.org/conda-forge
matplotlib  3.9.4    py39hdf13c20_0       16.60 KiB  conda  https://conda.anaconda.org/conda-forge
python      3.9.23   h7139b31_0_cpython   10.47 MiB  conda  https://conda.anaconda.org/conda-forge

Operating system

MaxOSX 26.2

Matplotlib Version

3.10.8

Matplotlib Backend

TkAgg

Python version

3.14.3

Jupyter version

No response

Installation

pixi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions