]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-50966: Fix unbounded recursion in turtle drag handlers (GH-152626)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 30 Jun 2026 09:19:43 +0000 (12:19 +0300)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 09:19:43 +0000 (12:19 +0300)
commit6f103fab178c07cbb5f701b8ad97e275b6eb6c4c
tree49c4c9696a491a577659783ede6ecf6d0b6186ac
parent11d42bd269788a0dd9ff954b63d7fd7139c3e46f
gh-50966: Fix unbounded recursion in turtle drag handlers (GH-152626)

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().

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]