Skip to content

Conversation

@gpshead
Copy link
Member

@gpshead gpshead commented Jan 12, 2026

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.

@duaneg FYI

…er `__main__` preload

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 pythongh-126631 main
preloading fix.
@gpshead gpshead self-assigned this Jan 12, 2026
@gpshead gpshead added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jan 12, 2026
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 12, 2026
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 30b347f 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143717%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 12, 2026
Copy link
Contributor

@duaneg duaneg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gpshead gpshead merged commit 298d544 into python:main Jan 12, 2026
115 of 123 checks passed
@miss-islington-app
Copy link

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @gpshead, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 298d5440eb83f2dfd5651bac86d1592ec358d54c 3.13

@bedevere-app
Copy link

bedevere-app bot commented Jan 12, 2026

GH-143763 is a backport of this pull request to the 3.14 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 12, 2026
…er `__main__` preload (pythonGH-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 pythongh-126631 main
preloading fix.
(cherry picked from commit 298d544)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jan 12, 2026
gpshead added a commit that referenced this pull request Jan 13, 2026
…ver `__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 298d544)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.x (tier-2) has failed when building commit 298d544.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/725/builds/12531) and take a look at the build logs.
  4. Check if the failure is related to this commit (298d544) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/725/builds/12531

Failed tests:

  • test_urllib2net

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 23, done.        
remote: Counting objects:   4% (1/23)        
remote: Counting objects:   8% (2/23)        
remote: Counting objects:  13% (3/23)        
remote: Counting objects:  17% (4/23)        
remote: Counting objects:  21% (5/23)        
remote: Counting objects:  26% (6/23)        
remote: Counting objects:  30% (7/23)        
remote: Counting objects:  34% (8/23)        
remote: Counting objects:  39% (9/23)        
remote: Counting objects:  43% (10/23)        
remote: Counting objects:  47% (11/23)        
remote: Counting objects:  52% (12/23)        
remote: Counting objects:  56% (13/23)        
remote: Counting objects:  60% (14/23)        
remote: Counting objects:  65% (15/23)        
remote: Counting objects:  69% (16/23)        
remote: Counting objects:  73% (17/23)        
remote: Counting objects:  78% (18/23)        
remote: Counting objects:  82% (19/23)        
remote: Counting objects:  86% (20/23)        
remote: Counting objects:  91% (21/23)        
remote: Counting objects:  95% (22/23)        
remote: Counting objects: 100% (23/23)        
remote: Counting objects: 100% (23/23), done.        
remote: Compressing objects:   7% (1/13)        
remote: Compressing objects:  15% (2/13)        
remote: Compressing objects:  23% (3/13)        
remote: Compressing objects:  30% (4/13)        
remote: Compressing objects:  38% (5/13)        
remote: Compressing objects:  46% (6/13)        
remote: Compressing objects:  53% (7/13)        
remote: Compressing objects:  61% (8/13)        
remote: Compressing objects:  69% (9/13)        
remote: Compressing objects:  76% (10/13)        
remote: Compressing objects:  84% (11/13)        
remote: Compressing objects:  92% (12/13)        
remote: Compressing objects: 100% (13/13)        
remote: Compressing objects: 100% (13/13), done.        
remote: Total 13 (delta 10), reused 2 (delta 0), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '298d5440eb83f2dfd5651bac86d1592ec358d54c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 298d5440eb8 gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (#143717)
Switched to and reset branch 'main'

make: *** [buildbottest] Error 2

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.x (tier-2) has failed when building commit 298d544.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/725/builds/12532) and take a look at the build logs.
  4. Check if the failure is related to this commit (298d544) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/725/builds/12532

Failed tests:

  • test_urllib2net

Summary of the results of the build (if available):

==

Click to see traceback logs
Note: switching to '298d5440eb83f2dfd5651bac86d1592ec358d54c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 298d5440eb8 gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (#143717)
Switched to and reset branch 'main'

make: *** [buildbottest] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.13 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants