cpython/Lib/multiprocessing
Gregory P. Smith 25369a8c78
[3.14] gh-144503: Pass sys.argv to forkserver as real argv elements (GH-148194) (#148195)
Avoid embedding the parent's sys.argv into the forkserver -c command
string via repr().  When sys.argv is large (e.g. thousands of file
paths from a pre-commit hook), the resulting single argument could
exceed the OS per-argument length limit (MAX_ARG_STRLEN on Linux,
typically 128 KiB), causing posix_spawn to fail and the parent to
observe a BrokenPipeError.

Instead, append the argv entries as separate command-line arguments
after -c; the forkserver child reads them back as sys.argv[1:].  This
cannot exceed any limit the parent itself did not already satisfy.

Regression introduced by gh-143706 / 298d5440eb.
(cherry picked from commit 5e9d90b615)
2026-04-07 06:19:32 +00:00
..
dummy [3.14] gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814) (#139084) 2025-10-08 00:37:30 +00:00
__init__.py
connection.py [3.14] gh-137335: Fix unlikely name conflicts for named pipes in multiprocessing and asyncio on Windows (GH-137389) (GH-145170) 2026-02-24 17:21:48 +00:00
context.py [3.14] gh-140814: Fix freeze_support() setting start method as side effect (GH-144608) (#146008) 2026-03-16 06:17:34 +00:00
forkserver.py [3.14] gh-144503: Pass sys.argv to forkserver as real argv elements (GH-148194) (#148195) 2026-04-07 06:19:32 +00:00
heap.py
managers.py gh-115942: Add locked to several multiprocessing locks (#115944) 2025-04-08 11:14:12 +03:00
pool.py gh-109649: Use os.process_cpu_count() (#110165) 2023-10-01 03:14:57 +02:00
popen_fork.py gh-131913: multiprocessing: add interrupt for POSIX (GH-132453) 2025-04-22 23:55:24 -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.14] gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (gh-118982) (GH-138605) 2025-10-08 14:22:05 +02: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 [3.14] gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814) (#139084) 2025-10-08 00:37:30 +00:00
queues.py [3.14] gh-133146: Add the old public get_value method to documentation and refactor code. (GH-133301) (#142110) 2025-11-30 13:06:56 -08:00
reduction.py gh-97514: Authenticate the forkserver control socket. (GH-99309) 2024-11-20 08:18:58 -08: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.14] gh-142206: multiprocessing.resource_tracker: Decode messages using older protocol (GH-142215) (GH-142285) 2025-12-05 12:47:30 +01:00
shared_memory.py gh-121288: Make error message for index() methods consistent (GH-121395) 2024-07-05 10:50:45 -07:00
sharedctypes.py
spawn.py [3.14] gh-109263: Start process from spawn context in multiprocessing no longer have side effect (GH-135813) (#143115) 2025-12-24 03:04:46 +00:00
synchronize.py [3.14] gh-133146: Add the old public get_value method to documentation and refactor code. (GH-133301) (#142110) 2025-11-30 13:06:56 -08:00
util.py [3.14] gh-140734: fix off-by-one error when comparing to _SUN_PATH_MAX (GH-140903) (#141181) 2025-11-07 10:27:14 +00:00