gh-152680: Use the _wmi module in test.pythoninfo#152824
Conversation
On Windows, replace wmic command with _wmi module to get the operating system caption and version. The wmic tool is deprecated since January 2024: https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242 For example, it's no longer installed in Windows images on GitHub Action. Fix also run_command(): no longer try to spawn a subprocess if the platform doesn't support subprocess. It avoids logging run_command() errors.
|
I checked test.pythoninfo output of the GitHub Action "Windows / Build and test (x64, tail-call)" job. With this PR: With this change, test.pythoninfo is able to get the operating system caption and version even if |
|
!buildbot Windows |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit bb6099d 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F152824%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
!buildbot Windows |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit 1761ea8 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F152824%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
"AMD64 Windows PGO NoGIL PR" buildbot: GHA "Windows / Build and test (x64, tail-call)" job: |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-152888 is a backport of this pull request to the 3.13 branch. |
|
GH-152890 is a backport of this pull request to the 3.15 branch. |
|
GH-152889 is a backport of this pull request to the 3.14 branch. |
…152824) (#152888) gh-152680: Detect virtualization on Windows in pythoninfo (GH-152824) Use WMI to detect virtualization on Windows. Replace wmic command with _wmi module to get the operating system caption and version. The wmic tool is deprecated since January 2024: https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242 For example, it's no longer installed in Windows images on GitHub Action. Fix also run_command(): no longer try to spawn a subprocess if the platform doesn't support subprocess. It avoids logging run_command() errors. (cherry picked from commit 4e4869b) Co-authored-by: Victor Stinner <vstinner@python.org>
…152824) (#152890) gh-152680: Detect virtualization on Windows in pythoninfo (GH-152824) Use WMI to detect virtualization on Windows. Replace wmic command with _wmi module to get the operating system caption and version. The wmic tool is deprecated since January 2024: https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242 For example, it's no longer installed in Windows images on GitHub Action. Fix also run_command(): no longer try to spawn a subprocess if the platform doesn't support subprocess. It avoids logging run_command() errors. (cherry picked from commit 4e4869b) Co-authored-by: Victor Stinner <vstinner@python.org>
…152824) (#152889) gh-152680: Detect virtualization on Windows in pythoninfo (GH-152824) Use WMI to detect virtualization on Windows. Replace wmic command with _wmi module to get the operating system caption and version. The wmic tool is deprecated since January 2024: https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242 For example, it's no longer installed in Windows images on GitHub Action. Fix also run_command(): no longer try to spawn a subprocess if the platform doesn't support subprocess. It avoids logging run_command() errors. (cherry picked from commit 4e4869b) Co-authored-by: Victor Stinner <vstinner@python.org>
On Windows, replace wmic command with _wmi module to get the operating system caption and version.
The wmic tool is deprecated since January 2024:
https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242
For example, it's no longer installed in Windows images on GitHub Action.
Fix also run_command(): no longer try to spawn a subprocess if the platform doesn't support subprocess. It avoids logging run_command() errors.