summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
diff options
context:
space:
mode:
authorShreyan Avigyan <shreyan.avigyan@gmail.com>2021-04-22 16:43:37 (GMT)
committerGitHub <noreply@github.com>2021-04-22 16:43:37 (GMT)
commit2a3f4899c63806439e5bcea0c30f7e6a6295a763 (patch)
treec7f22925627748c1c5f71f0ea3f2948112512fac /Doc/library/sys.rst
parenta07da09ad5bd7d234ccd084a3a0933c290d1b592 (diff)
downloadcpython-2a3f4899c63806439e5bcea0c30f7e6a6295a763.zip
cpython-2a3f4899c63806439e5bcea0c30f7e6a6295a763.tar.gz
cpython-2a3f4899c63806439e5bcea0c30f7e6a6295a763.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.
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r--Doc/library/sys.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index fe1cca1..ec12e02 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -796,11 +796,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