Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sy…
…s.getwindowsversion() (GH-25500) The sys module uses the kernel32.dll version number, which can vary from the "actual" Windows version. Since the best option for getting the version is WMI (which is expensive), we switch back to launching cmd.exe (which is also expensive, but a lot less code on our part). sys.getwindowsversion() is not updated to avoid launching executables from that module.
- Loading branch information
1 parent
a07da09
commit 2a3f489
Showing
3 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Misc/NEWS.d/next/Library/2021-04-21-14-50-57.bpo-43284.2QZn2T.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
platform.win32_ver derives the windows version from | ||
sys.getwindowsversion().platform_version which in turn derives the version | ||
from kernel32.dll (which can be of a different version than Windows itself). | ||
Therefore change the platform.win32_ver to determine the version using the | ||
platform module's _syscmd_ver private function to return an accurate | ||
version. |