This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Orbital, bugale bugale, corona10, eryksun, paul.moore, shreyanavigyan, steve.dower, tim.golden, zach.ware
Date 2021-04-16.17:18:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618593510.88.0.973079545407.issue43284@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2021-04-16 17:18:30eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, corona10, bugale bugale, shreyanavigyan, Orbital
2021-04-16 17:18:30eryksunsetmessageid: <1618593510.88.0.973079545407.issue43284@roundup.psfhosted.org>
2021-04-16 17:18:30eryksunlinkissue43284 messages
2021-04-16 17:18:30eryksuncreate