]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-140814: Fix freeze_support() setting start method as side effect (GH-144608...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 16 Mar 2026 06:13:21 +0000 (07:13 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Mar 2026 06:13:21 +0000 (06:13 +0000)
commit20704014112b41b245373aba7dfc070c209c1678
tree7a59a82d960c6138026ca956220205ca3949951e
parent102cd617639cef4acff964c0372e14685d660ecf
[3.13] gh-140814: Fix freeze_support() setting start method as side effect (GH-144608) (#146009)

gh-140814: Fix freeze_support() setting start method as side effect (GH-144608)

freeze_support() called get_start_method() without allow_none=True,
which locked in the default start method context. This caused a
subsequent set_start_method() call to raise "context has already been
set". Use allow_none=True and accept None as a matching value, since
spawn.freeze_support() independently detects spawned child processes.

Test that freeze_support() does not lock in the default start method,
which would prevent a subsequent set_start_method() call.
(cherry picked from commit ee5318025b0f9f4d30d9358627df68181e0d223f)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/multiprocessing/context.py
Lib/test/_test_multiprocessing.py
Misc/NEWS.d/next/Library/2026-02-08-22-04-06.gh-issue-140814.frzSpn.rst [new file with mode: 0644]