]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 13 Jan 2026 00:13:41 +0000 (01:13 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Jan 2026 00:13:41 +0000 (00:13 +0000)
commitf663aa226a0baa0c66421523185ab29eb53d1631
tree72e313787e618ef3426eb8dc13afc7bc66824999
parent110a77bf2d0e3379b49b6810b65245ea69a0f248
[3.14] gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (GH-143717) (#143763)

gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (GH-143717)

The forkserver was not passing sys.argv to its main() function, causing
sys.argv to be empty during `__main__` module import in child processes. This
fixes a non-obvious regression inadvertently introduced by the gh-126631 main
preloading fix.
(cherry picked from commit 298d5440eb83f2dfd5651bac86d1592ec358d54c)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Lib/multiprocessing/forkserver.py
Lib/test/_test_multiprocessing.py
Lib/test/mp_preload_sysargv.py [new file with mode: 0644]
Misc/NEWS.d/next/Library/2026-01-12-07-17-38.gh-issue-143706.sysArgv.rst [new file with mode: 0644]