]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__...
authorGregory P. Smith <68491+gpshead@users.noreply.github.com>
Wed, 14 Jan 2026 02:09:05 +0000 (18:09 -0800)
committerGitHub <noreply@github.com>
Wed, 14 Jan 2026 02:09:05 +0000 (18:09 -0800)
commit480f48035b7c772f9cca68268b86b88ff256d012
tree00c33ee4fe9a7a15f6cb620c062deb24a4eac6be
parentb6c6c476934ca66b0886c08f1b6b82387c0f35d6
[3.13] gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (GH-143717) (#143821)

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)
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]