Title: gh-148750: Fix embed layout pythoninfo failure and guard missing test-results publish in Azure by emixor · Pull Request #149926 · python/cpython · GitHub
Open Graph Title: gh-148750: Fix embed layout pythoninfo failure and guard missing test-results publish in Azure by emixor · Pull Request #149926 · python/cpython
X Title: gh-148750: Fix embed layout pythoninfo failure and guard missing test-results publish in Azure by emixor · Pull Request #149926 · python/cpython
Description: Summary This PR fixes the Windows embed-layout CI failure and reduces related Azure test-result publishing noise. The root cause is in test.pythoninfo on Windows. collect_windows() launches wmic with encoding="oem", which can raise LookupError: unknown encoding: oem in embed-layout environments. This PR switches to an explicit codec built from _winapi.GetOEMCP(). It also keeps Azure layout jobs resilient by skipping the test.pythoninfo step for kind: embed, and by publishing layout test results only when the XML file exists. Changes 1. Lib/test/pythoninfo.py Use the OEM code page from _winapi.GetOEMCP(). Record it with info_add("windows.oem_code_page", ...). Decode wmic output with an explicit codec (cp{OEMCP}) instead of "oem". Use a local wmic_encoding variable for the Popen(..., encoding=...) call. 2. .azure-pipelines/windows-layout-steps.yml Run .\python.exe -m test.pythoninfo only when parameters.kind != 'embed'. For parameters.kind == 'embed', keep the step slot but emit a clear skip message. Update PublishTestResults@2 condition to: and(succeededOrFailed(), exists('$(Build.BinariesDirectory)\test-results-${{ parameters.kind }}.xml')) so publishing is attempted only when the XML file is present. Why this approach The Python change addresses the codec failure directly. The pipeline changes prevent a known embed-layout diagnostic step from failing the job and avoid warning-only noise when no JUnit XML is produced. Testing python -m py_compile Lib/test/pythoninfo.py Local codec sanity check: codecs.lookup("oem") fails with LookupError codecs.lookup("cp437") resolves Pipeline behavior validated by template inspection for both embed and non-embed paths. Issue: gh-148750
Open Graph Description: Summary This PR fixes the Windows embed-layout CI failure and reduces related Azure test-result publishing noise. The root cause is in test.pythoninfo on Windows. collect_windows() launches wmic wi...
X Description: Summary This PR fixes the Windows embed-layout CI failure and reduces related Azure test-result publishing noise. The root cause is in test.pythoninfo on Windows. collect_windows() launches wmic wi...
Opengraph URL: https://github.com/python/cpython/pull/149926
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:9c89c54d-30bd-84fa-4bb6-8bed602a12ba |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8B1A:382318:8ABFBE:AE848A:6B021692 |
| html-safe-nonce | 3364abd28075a870c43491fd3470b8e9fc0c34d31c044a61989b04e52a4c5ff9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjFBOjM4MjMxODo4QUJGQkU6QUU4NDhBOjZCMDIxNjkyIiwidmlzaXRvcl9pZCI6IjU4MzY4MDQ3ODI2MTM5OTMxMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5a1ba93751bb9909220e32a706e4120cf8fdfba986d902ae621a5bc5e82e7d29 |
| hovercard-subject-tag | pull_request:3695685398 |
| 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/149926/files |
| twitter:image | https://avatars.githubusercontent.com/u/224896369?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224896369?s=400&v=4 |
| og:image:alt | Summary This PR fixes the Windows embed-layout CI failure and reduces related Azure test-result publishing noise. The root cause is in test.pythoninfo on Windows. collect_windows() launches wmic wi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width