GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.11] Fix Windows build regen with Python 3.15 as the host Python by ambv · Pull Request #160621 · python/cpython

Conversation

@ambv

@ambv ambv commented Oct 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Every Windows CI build on the 3.11 branch currently fails in the Build CPython step, independently of the change under test (see e.g. the x64 job on #160572 and the branch push run for e4f63e65a93):

  File "D:\a\cpython\cpython\Python\makeopcodetargets.py", line 27, in find_module
    return SourceFileLoader(modname, modpath).load_module()
AttributeError: 'SourceFileLoader' object has no attribute 'load_module'. Did you mean '.exec_module' instead of '.load_module'?

Cause.
PCbuild/find_python.bat on 3.11 only probes py -3.10 and py -3.9. The windows-2022 runner image dropped Python 3.10 (the last passing run on Oct 1 still found it), so the script fell through to NuGet and installed the latest pythonx86 package, which is now 3.15.1. Python 3.15 removed Loader.load_module(), and Python/makeopcodetargets.py used it to import Lib/opcode.py. The regen target runs on every fresh checkout, so the build aborts before any test runs. 3.12 is unaffected only because its find_python.bat already probes py -3.13.

Fix.

  • Python/makeopcodetargets.py: load Lib/opcode.py via importlib.util.spec_from_file_location() + exec_module(); drop the dead imp fallback (as 3.12 did in Remove more deprecated importlib APIs from Python 3.12 #98040). Output verified byte-identical to the checked-in Python/opcode_targets.h under Python 3.9, 3.12 and 3.14 (with -W error).
  • PCbuild/find_python.bat: extend the py.exe search list to 3.14 3.13 3.12 3.11 3.10 3.9, so CI uses the runner's preinstalled Python instead of whatever NuGet considers latest. Every other script invoked by PCbuild/regen.targets already runs cleanly under 3.14 with -W error.

Infrastructure-only change, no user-visible behavior; skip news applies.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ambv @claude
[3.11] Fix Windows build regen with Python 3.15 as the host Python
3c8003e
The windows-2022 GitHub runner image no longer ships Python 3.10, so
PCbuild/find_python.bat fell through to NuGet and installed the latest
pythonx86 package, which is now 3.15.1. Python 3.15 removed
Loader.load_module(), which Python/makeopcodetargets.py used to import
Lib/opcode.py, so the _RegenOpcodes target failed and broke every
Windows CI build on this branch.

Load Lib/opcode.py through importlib.util instead, and extend the py.exe
search list in find_python.bat up to 3.14 so the build picks up the
runner's preinstalled Python rather than whatever NuGet considers latest.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@ambv
ambv requested a review from a team as a code owner October 24, 2026 20:08
@ambv ambv added skip issue skip news labels Oct 24, 2026
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 24, 2026
@ambv ambv mentioned this pull request Oct 24, 2026
[3.11] gh-160040: Distrust compromised eMudhra intermediate CA keys (CVE-2026-115557) (GH-160042) #160572
Merged
emmatyping
emmatyping approved these changes Oct 24, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Oct 24, 2026
@ambv
ambv merged commit 0fc0183 into python:3.11 Oct 24, 2026
25 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 24, 2026
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 27, 2026
@ambv @icanhasmath
[3.11] Fix Windows build regen with Python 3.15 as the host Python (p…
994c81d
…ython#160621)

The windows-2022 GitHub runner image no longer ships Python 3.10, so
PCbuild/find_python.bat fell through to NuGet and installed the latest
pythonx86 package, which is now 3.15.1. Python 3.15 removed
Loader.load_module(), which Python/makeopcodetargets.py used to import
Lib/opcode.py, so the _RegenOpcodes target failed and broke every
Windows CI build on this branch.

Load Lib/opcode.py through importlib.util instead, and extend the py.exe
search list in find_python.bat up to 3.14 so the build picks up the
runner's preinstalled Python rather than whatever NuGet considers latest.

Co-authored-by: Claude Fable 5.1 <[email protected]>
(cherry picked from commit 0fc0183)

3.10.22.x: 3.10's py.exe probe accepted 3.9 and 3.8; the new list keeps
3.8 as the floor and prefers 3.14 down to 3.9 first. Build tooling only;
needed so the Windows CI jobs build at all now that the runner falls
through to a Python 3.15 host.
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 27, 2026
@ambv @icanhasmath
[3.11] Fix Windows build regen with Python 3.15 as the host Python (p…
4fa495e
…ython#160621)

The windows-2022 GitHub runner image no longer ships Python 3.10, so
PCbuild/find_python.bat fell through to NuGet and installed the latest
pythonx86 package, which is now 3.15.1. Python 3.15 removed
Loader.load_module(), which Python/makeopcodetargets.py used to import
Lib/opcode.py, so the _RegenOpcodes target failed and broke every
Windows CI build on this branch.

Load Lib/opcode.py through importlib.util instead, and extend the py.exe
search list in find_python.bat up to 3.14 so the build picks up the
runner's preinstalled Python rather than whatever NuGet considers latest.

Co-authored-by: Claude Fable 5.1 <[email protected]>
(cherry picked from commit 0fc0183)

3.10.22.x: 3.10's py.exe probe accepted 3.9 and 3.8; the new list keeps
3.8 as the floor and prefers 3.14 down to 3.9 first. Build tooling only;
needed so the Windows CI jobs build at all now that the runner falls
through to a Python 3.15 host.
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 28, 2026
@ambv @icanhasmath
[3.11] Fix Windows build regen with Python 3.15 as the host Python (p…
77bb57f
…ython#160621)

The windows-2022 GitHub runner image no longer ships Python 3.10, so
PCbuild/find_python.bat fell through to NuGet and installed the latest
pythonx86 package, which is now 3.15.1. Python 3.15 removed
Loader.load_module(), which Python/makeopcodetargets.py used to import
Lib/opcode.py, so the _RegenOpcodes target failed and broke every
Windows CI build on this branch.

Load Lib/opcode.py through importlib.util instead, and extend the py.exe
search list in find_python.bat up to 3.14 so the build picks up the
runner's preinstalled Python rather than whatever NuGet considers latest.

Co-authored-by: Claude Fable 5.1 <[email protected]>
(cherry picked from commit 0fc0183)

3.10.22.x: 3.10's py.exe probe accepted 3.9 and 3.8; the new list keeps
3.8 as the floor and prefers 3.14 down to 3.9 first. Build tooling only;
needed so the Windows CI jobs build at all now that the runner falls
through to a Python 3.15 host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@emmatyping emmatyping emmatyping approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ambv @emmatyping
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.