Steve Dower <steve.do...@python.org> added the comment:

sys.getwindowsversion() is affected to Microsoft's minimal rebuilds of 
OS components causing core DLLs to have older versions than the release, 
and also to compatibility modes that may report earlier versions if API 
behaviour is being emulated.

The best way for us to use WMI is to call it directly. There are native 
APIs to access it and retrieve the data directly. It's just nobody has 
written it yet.

Calling out to Powershell needs to account for cases where Powershell is 
not present, is disabled/blocked/limited, or is a different version. We 
can rely on the native APIs (at least, if they fail, there's nothing 
better we could possibly have done).

WMI is essentially the Windows equivalent of the platform module, so 
there's no reason all the APIs in platform.py shouldn't use it, and 
every reason that sys/os *shouldn't* use it.

----------

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

Reply via email to