Title: [3.11] Fix Windows build regen with Python 3.15 as the host Python by ambv · Pull Request #160621 · python/cpython · GitHub
Open Graph Title: [3.11] Fix Windows build regen with Python 3.15 as the host Python by ambv · Pull Request #160621 · python/cpython
X Title: [3.11] Fix Windows build regen with Python 3.15 as the host Python by ambv · Pull Request #160621 · python/cpython
Description: 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 gh-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.
Open Graph Description: 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)...
X Description: 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)...
Opengraph URL: https://github.com/python/cpython/pull/160621
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ba676cda-35ec-84f7-4c1d-2de620e07fc5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C9AC:230337:231248:2E73EC:6AFE98E9 |
| html-safe-nonce | e8be8a893a0b966ed4a2cda6163f2d0b45b4281557e843da1bb64a309a193e6e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUFDOjIzMDMzNzoyMzEyNDg6MkU3M0VDOjZBRkU5OEU5IiwidmlzaXRvcl9pZCI6IjY3OTI2OTA3MzI2MjE1MzU0NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f407da3dd9fff2d8f62ee2d4033c8ef1fcf8c68940d56a4a3143550cd5b39791 |
| hovercard-subject-tag | pull_request:4998732547 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/160621/files |
| twitter:image | https://avatars.githubusercontent.com/u/55281?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55281?s=400&v=4 |
| og:image:alt | 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)... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width