]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] gh-50966: Fix unbounded recursion in turtle drag handlers (GH-152626) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 30 Jun 2026 10:14:56 +0000 (12:14 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 10:14:56 +0000 (13:14 +0300)
commit86a836aab198e9cf1f3ddd618046024fe882a07f
tree84299cdc1ae2999650e2161f851e8f11e5076754
parent3b1f6eef837c2e4ab364aed12f23bbc12b513a6d
[3.15] gh-50966: Fix unbounded recursion in turtle drag handlers (GH-152626) (GH-152657)

TurtleScreenBase._update() redraws with cv.update(), which also reprocesses
input events, so a handler that moves the turtle (such as
screen.ondrag(turtle.goto)) reenters _update() for every queued event until
the interpreter crashes.  A reentrant _update() now only flushes drawing with
update_idletasks().
(cherry picked from commit 6f103fab178c07cbb5f701b8ad97e275b6eb6c4c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_turtle.py
Lib/turtle.py
Misc/NEWS.d/next/Library/2026-06-29-22-16-57.gh-issue-50966.Tq5mLp.rst [new file with mode: 0644]