diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-04-22 17:03:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 17:03:36 (GMT) |
commit | ef63328b46fe7402794cde51008a47e79f37b153 (patch) | |
tree | a5d37d1f1edec82a88beaeaf3c5d80f46df9315a /Doc | |
parent | f7bc44170b4bdd16c46b4b6acf7673ffc24dfb19 (diff) | |
download | cpython-ef63328b46fe7402794cde51008a47e79f37b153.zip cpython-ef63328b46fe7402794cde51008a47e79f37b153.tar.gz cpython-ef63328b46fe7402794cde51008a47e79f37b153.tar.bz2 |
bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sys.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.
(cherry picked from commit 2a3f4899c63806439e5bcea0c30f7e6a6295a763)
Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/sys.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 95cbaf2..7e11dc0 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -778,11 +778,16 @@ always available. Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information about these fields. - *platform_version* returns the accurate major version, minor version and + *platform_version* returns the major version, minor version and build number of the current operating system, rather than the version that is being emulated for the process. It is intended for use in logging rather than for feature detection. + .. note:: + *platform_version* derives the version from kernel32.dll which can be of a different + version than the OS version. Please use :mod:`platform` module for achieving accurate + OS version. + .. availability:: Windows. .. versionchanged:: 3.2 |