]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-129967: Fix race condition in `repr(set)` (gh-129978) (gh-130020)
authorSam Gross <colesbury@gmail.com>
Tue, 11 Feb 2025 23:18:12 +0000 (18:18 -0500)
committerGitHub <noreply@github.com>
Tue, 11 Feb 2025 23:18:12 +0000 (18:18 -0500)
commitee12a3482dc8ef06dc2851b5ea074de123a5e02a
treed940542374385c2a810b396b513403f5001ee789
parent36790830cb7f55e1a95a0041baf5bbf980098b23
[3.13] gh-129967: Fix race condition in `repr(set)` (gh-129978) (gh-130020)

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

(cherry picked from commit a7427f2db937adb4c787754deb4c337f1894fe86)

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