Skip to content

[3.13] gh-83274: Don't crash when a Tcl interpreter is deallocated in the wrong thread (GH-152323)#153278

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-46d1809-3.13
Jul 7, 2026
Merged

[3.13] gh-83274: Don't crash when a Tcl interpreter is deallocated in the wrong thread (GH-152323)#153278
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-46d1809-3.13

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

…ted in the wrong thread (pythonGH-152323)

Deallocating the interpreter from a thread other than the one it was created
in ran Tcl_DeleteInterp() there, which makes Tcl abort the process
("Tcl_AsyncDelete: async handler deleted by the wrong thread").

Tkapp_Dealloc() now leaks the interpreter in that case and reports a
RuntimeWarning instead.

(cherry picked from commit 46d1809)

Co-authored-by: E. Paine <63801254+E-Paine@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) July 7, 2026 16:21
@serhiy-storchaka serhiy-storchaka merged commit 918b82a into python:3.13 Jul 7, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant