Eryk Sun <eryk...@gmail.com> added the comment:

> shouldn't the documentation provide the information that 
> sys.getwindowsversion().platform_version returns the 
> kernel32.dll version?

platform_version is documented as an "accurate major version, minor version and 
build number of the current operating system, rather than the version that is 
being emulated for the process". That's it's currently using the file version 
of "kernel32.dll" is an implementation detail, one that needs to be changed to 
something more reliable.

Keep in mind that the Python DLL can be embedded in any application, which may 
not be manifested to get the true OS version via GetVersionExW(). For example, 
when running in Windows 10, the default with no manifest reports Windows 8 (NT 
6.2):

    >>> sys.getwindowsversion()
    sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, 
service_pack='')

Here it is with a manifest that supports Windows 8.1 (NT 6.3):

    >>> sys.getwindowsversion()
    sys.getwindowsversion(major=6, minor=3, build=9600, platform=2, 
service_pack='')

This is the OS version that's relevant to the application, but for logging and 
other diagnostics, platform_version is provided to get the real version, at 
least if all goes according to plan.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43284>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to