]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-129967: Fix race condition in `repr(set)` (gh-129978)
authorSam Gross <colesbury@gmail.com>
Tue, 11 Feb 2025 22:29:27 +0000 (17:29 -0500)
committerGitHub <noreply@github.com>
Tue, 11 Feb 2025 22:29:27 +0000 (17:29 -0500)
commita7427f2db937adb4c787754deb4c337f1894fe86
tree8506cb6a4cfb41e5d575b35f052502de3bfb9005
parent1f233f56d6a5216b18e8c3f6b8c14d7e5d62c340
gh-129967: Fix race condition in `repr(set)` (gh-129978)

The call to `PySequence_List()` could temporarily unlock and relock the
set, allowing the items to be cleared and return the incorrect
notation `{}` for a empty set (it should be `set()`).

Co-authored-by: T. Wouters <thomas@python.org>
Lib/test/test_free_threading/test_set.py [new file with mode: 0644]
Misc/NEWS.d/next/Core_and_Builtins/2025-02-10-20-01-56.gh-issue-129967.J60tEl.rst [new file with mode: 0644]
Objects/setobject.c