cpython/Lib/multiprocessing
Miss Islington (bot) 2070401411
[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 ee5318025b)

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>
2026-03-16 06:13:21 +00:00
..
dummy bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
__init__.py Simplify __all__ in multiprocessing (GH-6856) 2018-07-11 19:22:28 +09:00
connection.py [3.13] gh-137335: Fix unlikely name conflicts for named pipes in multiprocessing and asyncio on Windows (GH-137389) (GH-145171) 2026-02-24 17:20:53 +00:00
context.py [3.13] gh-140814: Fix freeze_support() setting start method as side effect (GH-144608) (#146009) 2026-03-16 06:13:21 +00:00
forkserver.py [3.13] gh-143706: Fix sys.argv not set during multiprocessing forkserver __main__ preload (GH-143717) (#143821) 2026-01-13 18:09:05 -08:00
heap.py bpo-32759: Free unused arenas in multiprocessing.heap (GH-5827) 2018-04-09 17:37:55 +02:00
managers.py [3.13] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) (GH-126869) 2024-11-15 14:05:14 +00:00
pool.py gh-109649: Use os.process_cpu_count() (#110165) 2023-10-01 03:14:57 +02:00
popen_fork.py gh-83856: Honor atexit for all multiprocessing start methods (GH-114279) 2024-05-03 11:45:46 -07:00
popen_forkserver.py bpo-36888: Add multiprocessing.parent_process() (GH-13247) 2019-05-20 21:37:05 +02:00
popen_spawn_posix.py [3.13] gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (gh-118982) (#138606) 2025-09-07 07:41:54 +00:00
popen_spawn_win32.py gh-118293: Suppress mouse cursor feedback when launching Windows processes with multiprocessing (GH-118315) 2024-04-28 21:10:44 +00:00
process.py gh-83856: Honor atexit for all multiprocessing start methods (GH-114279) 2024-05-03 11:45:46 -07:00
queues.py gh-71052: Enable test_concurrent_futures on platforms that lack multiprocessing (gh-115917) 2024-02-25 11:38:18 -08:00
reduction.py bpo-34521: Fix tests in test_multiprocessing_spawn to use correctly CMSG_SPACE (GH-9613) 2018-09-28 02:51:05 -07:00
resource_sharer.py gh-101225: Increase the socket backlog when creating a multiprocessing.connection.Listener (#113567) 2024-01-13 10:48:33 +01:00
resource_tracker.py [3.13] gh-142206: multiprocessing.resource_tracker: Decode messages using older protocol (GH-142215) (#142287) 2025-12-05 12:13:05 +00:00
shared_memory.py gh-82300: Add track parameter to multiprocessing.shared_memory (#110778) 2023-12-05 00:11:44 -08:00
sharedctypes.py bpo-32157: Removed explicit quotes around %r and {!r}. (#4582) 2017-11-28 22:54:42 +02:00
spawn.py [3.13] gh-109263: Start process from spawn context in multiprocessing no longer have side effect (GH-135813) (#143116) 2025-12-24 03:03:47 +00:00
synchronize.py [3.13] remove type annotations from multiprocessing. (GH-129381) (#129470) 2025-01-30 08:54:15 +00:00
util.py [3.13] gh-140734: fix off-by-one error when comparing to _SUN_PATH_MAX (GH-140903) (#141182) 2025-11-07 10:18:06 +00:00