]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] 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:17:34 +0000 (07:17 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Mar 2026 06:17:34 +0000 (06:17 +0000)
commita887eae459f9737359e3e8eb1ffb1d8e305a7f88
tree5fc932e12ceab2192b48f77ab13db8bc3fe6632d
parentb8cb83703f08e6546ae45b39f74026e79c77f149
[3.14] gh-140814: Fix freeze_support() setting start method as side effect (GH-144608) (#146008)

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]