]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-123471: Free-threading fixes for itertools (GH-131212) (GH-132814) (GH...
authorNeil Schemenauer <nas-github@arctrix.com>
Fri, 17 Jul 2026 20:20:36 +0000 (13:20 -0700)
committerGitHub <noreply@github.com>
Fri, 17 Jul 2026 20:20:36 +0000 (13:20 -0700)
commit45bfb43b34890db01fcd87454db17013b1a771e7
tree5de82638fd7bb3c030f08ff332053c1a1d2939f6
parent1ba35ca180aad60e0b3b6cbb65c10662856084f9
[3.14] gh-123471: Free-threading fixes for itertools (GH-131212) (GH-132814) (GH-135689) (GH-144402) (GH-146033) (GH-142957) (GH-153791)

Combined backport of PRs from main branch, fixing free-threading data-races in itertools:

* gh-123471: make concurrent iteration over `itertools.cycle` safe under free-threading (gh-131212)
* gh-123471: Make itertools.product and itertools.combinations thread-safe (GH-132814)
* gh-123471: Make itertools.chain thread-safe (gh-135689)
* gh-123471: Make concurrent iteration over `itertools.permutations` and `itertools.combinations_with_replacement` thread-safe (gh-144402)
* gh-123471: make concurrent iteration over itertools.accumulate thread-safe (gh-144486)
* gh-123471: Make `itertools.zip_longest` safe in the FT build (gh-146033)

(cherry picked from commit 26a1cd4e8c0c9ea1a6683abd82547ddee656ff3d)
(cherry picked from commit 847d1c2cb4014f122df64e0db0b3b554c01779c6)
(cherry picked from commit 0533c1faf27d1e50b062bb623dfad93288757f57)
(cherry picked from commit 009c8c052f5eb9f869c09029724ef194d8c161ca)
(cherry picked from commit 3a248564470075cb8c7b8a75fe7ba61f7ea341b2)
(cherry picked from commit 9214e3f33eeeb0ee862777378f98fdeb7b6944c6)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Lib/test/test_free_threading/test_itertools.py
Lib/test/test_free_threading/test_itertools_combinatoric.py [new file with mode: 0644]
Misc/NEWS.d/next/Library/2025-03-13-20-48-58.gh-issue-123471.cM4w4f.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2025-04-22-21-00-23.gh-issue-123471.asOLA2.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2025-06-18-19-25-32.gh-issue-123471.lx1Xbt.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2026-02-03-08-50-58.gh-issue-123471.yF1Gym.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2026-02-04-20-30-59.gh-issue-123471.1dnPvs.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2026-03-17-19-51-05.gh-issue-123471.oY4UR5.rst [new file with mode: 0644]
Modules/itertoolsmodule.c