Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is python giving the wrong windows version?

Tags:

python

windows

I want a program to determine which OS and its version is running on the computer. I was really confused when platform.release() returned '8' since my computer was originally running on windows 8 but I updated on windows 10 several months ago.

My guess would be that it is more of a windows issue than a python problem. Is there a way o fix this? Or should I use a different module than platform?

I am using python 3.4.3. The whole version name platform.platform() returns is 'Windows-8-6.2.9200' but I can't tell whether it is the very first version on the computer or the last one before the Update.

like image 808
r0w Avatar asked Feb 15 '26 05:02

r0w


1 Answers

From the Python Changelog Documentation for 3.4.4-release-candidate-1

bpo-19143: platform module now reads Windows version from kernel32.dll to avoid compatibility shims.

which fixes the referenced bug:

Python is returning incorrect version info under Windows 8.1. ... it appears MS is "deprecating" GetVersionEx()

which references a StackOverflow question.

like image 70
robert_x44 Avatar answered Feb 17 '26 18:02

robert_x44



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!