Skip to content

gh-152433: Windows: improve sys.getwindowsversion() use RtlGetVersion for Desktop#152604

Open
thexai wants to merge 1 commit into
python:mainfrom
thexai:windows-version
Open

gh-152433: Windows: improve sys.getwindowsversion() use RtlGetVersion for Desktop#152604
thexai wants to merge 1 commit into
python:mainfrom
thexai:windows-version

Conversation

@thexai

@thexai thexai commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Windows: improve sys.getwindowsversion() use RtlGetVersion for Desktop.

Also fix errors in UWP.

Also fixes #146299

…tlGetVersion`` for Desktop

Also fix errors in UWP.
@thexai

thexai commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

For more context, the actual issue with sys.getwindowsversion() is that return incorrect value in recent Windows 11 versions:

e.g: in Windows 11 25H2 return 10.0.26100 instead of correct 10.0.26200.

(but not directly observable because only is used as second fallback on platform module)

With this change, it will be possible use sys.getwindowsversion() as the first fallback (after WMI) and will also be compatible with UWP.

In UWP, it would be the primary method because WMI is not available and subprocess "cmd ver" is also not available.

Related to #129294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows version from sys.getwindowsversion() is wrong in binaries that do not declare Windows 10 support

1 participant