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 sahsariga111
Recipients eryksun, lemburg, miss-islington, paul.moore, sahsariga111, steve.dower, tim.golden, vstinner, zach.ware
Date 2022-01-26.08:07:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAGuK6BWq5=V+CS+bjTEtE-Pu7f9xgrsCG_+iOHmP2qu6SC7nhQ@mail.gmail.com>
In-reply-to <1643173527.73.0.205584009929.issue45382@roundup.psfhosted.org>
Content
The quick research on web gived me that C/C++ developers will just get the
build version and compare it with predefined list.
See more there:
https://docs.microsoft.com/answers/questions/672988/c-detect-windows-build.html

ср, 26 янв. 2022 г., 05:05 Eryk Sun <report@bugs.python.org>:

>
> Eryk Sun <eryksun@gmail.com> added the comment:
>
> > sys.getwindowsversion() which exposes GetVersionEx() looks fine to me.
>
> In Windows 8+, sys.getwindowsversion() returns a version that can vary
> from 6.2.9200 (Windows 8) up to the actual OS version. It depends on the OS
> versions supported by the application manifest -- with 6.2.9200 used when
> there's no application manifest. The platform module uses the shell's VER
> command because it returns the real OS version.
>
> The version number for Windows 11 is 10.0.22000+. The platform module
> misreports this as Windows 10. In msg403452, I suggested a modification to
> use build numbers. In msg404451 Steve said we may as well use the WMI
> result to identify Windows 11 based on the OS caption. If we use WMI, we
> can choose to rely on wmic.exe (deprecated), PowerShell, or implement our
> own code in C/C++.
>
> > I don't understand why we have to handle XML or JSON and encoding...
>
> Using JSON or XML (ElementTree) isn't required, if you'd rather parse
> human-readable output. AFAIK, the Win32_OperatingSystem caption is always
> ASCII.
>
> In general, wmic.exe writes output text to a pipe that's encoded with the
> system OEM code page. pwsh.exe, powershell.exe, and cmd.exe write output
> text to a pipe (from their internal commands/cmdlets) that's encoded using
> the console's output code page. cmd.exe also supports a /U option to use
> UTF-16.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue45382>
> _______________________________________
>
History
Date User Action Args
2022-01-26 08:07:28sahsariga111setrecipients: + sahsariga111, lemburg, paul.moore, vstinner, tim.golden, zach.ware, eryksun, steve.dower, miss-islington
2022-01-26 08:07:28sahsariga111linkissue45382 messages
2022-01-26 08:07:28sahsariga111create