[Bug]: macOS: tkagg backend crashes on Control-C after input()
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Riproduci il crash su macOS con Python 3.14.5 usando lo script fornito e il backend TkAgg. Inizia esaminando la gestione da parte del backend TkAgg della figura non bloccante e dell’interruzione dell’input. Il lavoro è completato quando Control-C non produce più un errore fatale di Python e il comportamento corrisponde al risultato previsto senza crash.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug summary
- Run the attached code with the tkagg backend
- Control-C during the input()
- The following is displayed:
Fatal Python error: PyEval_RestoreThread: the function must
be called with the GIL held, after Python initialization and
before Python finalization, but the GIL is released (the current
Python thread state is NULL)
Code for reproduction
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
# matplotlib.use(backend="TkAgg")
plt.style.use("_mpl-gallery")
# Make data
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
# Plot the surface
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
ax.plot_surface(X, Y, Z, vmin=Z.min() * 2, cmap=cm.Blues)
ax.set(xticklabels=[], yticklabels=[], zticklabels=[])
plt.show(block=False)
input("Hit [return] to end")
plt.close("all")
Actual outcome
Fatal error. I got the following crash report one time, but haven't seen it since:
Expected outcome
Similar to #32016, not a crash, although I'm not 100% sure what it should do. I was thinking that the Control-C would either stop the input() call or immediately close the figure.
Additional information
No response
Operating system
macOS 14.8
Matplotlib Version
3.12.0.dev484+g162d8181d.d20260708
Matplotlib Backend
tkagg
Python version
3.14.5
Jupyter version
No response
Installation
None
- Lingua principale
- Python
- Stelle
- 23.2k
- Fork
- 8.5k
- Merge medio
- 1g 6h
- PR unite (30g)
- 68
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di matplotlib/matplotlib
-
[Bug]: macOS font discovery raises KeyError('_items') for an incomplete system_profiler font record Apertafirst-contribution OS: Apple status: needs clarification topic: text/fonts
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
matplotlib/matplotlib#32328 · 2 commenti ·
-
topic: ticks axis labels
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
matplotlib/matplotlib#32313 · 3 commenti ·
-
topic: plotting methods topic: ticks axis labels
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
matplotlib/matplotlib#32304 · 4 commenti ·
-
[Bug]: Line3D.draw requires .shape on _verts3d, but set_data_3d accepts and stores any array-like Apertafirst-contribution topic: mplot3d
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
matplotlib/matplotlib#32127 · 5 commenti ·
-
Documentation first-contribution
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
matplotlib/matplotlib#31935 · 4 commenti · 1 reazione ·
Tutte le issue di matplotlib/matplotlib
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
🐛 Bug 🔔 Pending processing
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
jumpserver/jumpserver#17584 ·