[issue45382] platform() is not able to detect windows 11

Evernow report at bugs.python.org
Sun Mar 27 23:14:47 EDT 2022


Evernow <danielsuarez369 at protonmail.com> added the comment:

As mentioned wmic is deprecated ( https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmic ). 

I don't see why the wmi module ( https://pypi.org/project/WMI/ ) can't be used instead to get the information, I have a working implementation of this that simply does the following: 

current_major_version = wmi.WMI().Win32_OperatingSystem()[0].Caption.encode("ascii", "ignore").decode(
            "utf-8")
if "8" in current_major_version:
        pass
elif "7" in current_major_version:  
        pass
elif "10" in current_major_version:  
        pass
elif "11" in current_major_version:
	pass

----------
nosy: +Evernow

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45382>
_______________________________________


More information about the Python-bugs-list mailing list