]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] 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:24:21 +0000 (12:24 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 10:24:21 +0000 (13:24 +0300)
commit4b5148c3ea38d8df42a49ba67643807710381b81
treeb69aad25c90bfd58e71e59de1936cd174c3519f1
parent5679ef5c3a0ec4b6165c09f7dc85a8f34326ece3
[3.14] gh-50966: Fix unbounded recursion in turtle drag handlers (GH-152626) (GH-152658)

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]