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

2022-03-28 Thread Tim Golden
Tim Golden added the comment: > I don't see why the wmi module ( https://pypi.org/project/WMI/ ) can't be > used instead to get the information Well I can speak here as the author of that module and as an (occasional) core developer. The wmi module stands on the shoulderes of the pywin32

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

2022-03-27 Thread Evernow
Evernow 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

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

2022-03-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 0b0609d0d1a2f231c94bab2177095dd9a46fc137 by Miss Islington (bot) in branch '3.9': [3.10] bpo-45382: test.pythoninfo logs more Windows versions (GH-30891) (GH-30894) https://github.com/python/cpython/commit/0b0609d0d1a2f231c94bab2177095dd9a46fc137

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

2022-01-26 Thread Steve Dower
Steve Dower added the comment: >> AFAIK, the Win32_OperatingSystem caption is always ASCII. > > I think I was wrong here. The "Caption" field is localized, so the wmic.exe > OEM encoded output to a pipe isn't reliable. Correct. And while "Windows" itself is never translated, the caption may

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

2022-01-26 Thread Steve Dower
Steve Dower 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

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

2022-01-26 Thread Eryk Sun
Eryk Sun added the comment: > AFAIK, the Win32_OperatingSystem caption is always ASCII. I think I was wrong here. The "Caption" field is localized, so the wmic.exe OEM encoded output to a pipe isn't reliable. The system OEM code page doesn't necessarily match the display/preferred language

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

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2022-01-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 26.01.2022 01:29, Eryk Sun wrote: > > Eryk Sun added the comment: > >> Bit wmic seems nice solution. >> Is still working for windows lower than 11? > > wmic.exe is still included in Windows 10 and 11, but it's officially > deprecated [1], which

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

2022-01-26 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: 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 --

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

2022-01-26 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: 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 :

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

2022-01-25 Thread Eryk Sun
Eryk Sun 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

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

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: I don't understand why we have to handle XML or JSON and encoding... just to get a version number. Why did Microsoft make it so complicated? sys.getwindowsversion() which exposes GetVersionEx() looks fine to me. --

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

2022-01-25 Thread Eryk Sun
Eryk Sun added the comment: > Bit wmic seems nice solution. > Is still working for windows lower than 11? wmic.exe is still included in Windows 10 and 11, but it's officially deprecated [1], which means it's no longer being actively developed, and it might be removed in a future update.

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

2022-01-25 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +29075 pull_request: https://github.com/python/cpython/pull/30894 ___ Python tracker

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

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4a57fa296b92125e41220ecd201eb2e432b79fb0 by Victor Stinner in branch '3.10': [3.10] bpo-45382: test.pythoninfo logs more Windows versions (GH-30891) https://github.com/python/cpython/commit/4a57fa296b92125e41220ecd201eb2e432b79fb0 --

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

2022-01-25 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: Thanks guys. Microsoft is always pain for us. Bit wmic seems nice solution. Is still working for windows lower than 11? -- ___ Python tracker

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

2022-01-25 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29074 pull_request: https://github.com/python/cpython/pull/30891 ___ Python tracker ___

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

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset cef0a5458f254c2f8536b928dee25862ca90ffa6 by Victor Stinner in branch 'main': bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890) https://github.com/python/cpython/commit/cef0a5458f254c2f8536b928dee25862ca90ffa6 --

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

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: > When writing to a pipe, wmic.exe hard codes using the process OEM code page > (i.e. CP_OEMCP). If it matters, running wmic.exe with subprocess should use > encoding='oem' instead of text=True. Oh ok, I wrote PR 30890 to fix the wmic.exe encoding. I would

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

2022-01-25 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29073 pull_request: https://github.com/python/cpython/pull/30890 ___ Python tracker ___

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

2022-01-24 Thread Eryk Sun
Eryk Sun added the comment: > It's *very* unlikely you'll ever get output that doesn't fit into MBCS, When writing to a pipe, wmic.exe hard codes using the process OEM code page (i.e. CP_OEMCP). If it matters, running wmic.exe with subprocess should use encoding='oem' instead of text=True.

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

2022-01-24 Thread Steve Dower
Steve Dower added the comment: Yeah, I pushed the machines up to 2022 the other day while tidying the configs. Wouldn't have expected it to impact that issue though, it's fully within OpenSSL, isn't it? (We also updated that recently...) Also, as an FYI, if you use "wmic /output:" then it

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

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: New changeset b0898f4aa90d9397e23aef98a2d6b82445ee7455 by Victor Stinner in branch 'main': bpo-45382: test.pythoninfo logs more Windows versions (GH-30817) https://github.com/python/cpython/commit/b0898f4aa90d9397e23aef98a2d6b82445ee7455 --

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

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: I wrote PR 30817 to log "ver" and "wmic os get Caption,Version /value" command output in test.pythoninfo. I would like to check if Windows Server 2022 is deployed on CI used by Python :-) I'm trying to understand why bpo-41682 "[Windows] test_asyncio:

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

2022-01-22 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29004 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30817 ___ Python tracker ___

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

2021-10-21 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: On my Win11 it returns me : C:\Users\Win10Home>wmic os get Caption,Version /value Caption=Microsoft Windows 11 Home Single Language Version=10.0.22000 -- ___ Python tracker

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

2021-10-20 Thread Steve Dower
Steve Dower added the comment: All that said, if we're going to shell out to "ver", we may as well try "wmic os get Caption,Version /value" first and parse its output. For me, it looks like the below (with a number of blank lines around it): Caption=Microsoft Windows 10 Enterprise

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

2021-10-08 Thread STINNER Victor
STINNER Victor added the comment: macOS has a similar issue in the platform module. Previously, platform gave the darwin kernel version, whereas most users only know macOS versions. See bpo-35344. Even if Microsoft decided to internally stay at 10.x, IMO users really expect "Windows 11"

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

2021-10-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 08.10.2021 02:15, Eryk Sun wrote: > >> use the build number as reference instead of the major.minor > > It could check the (major, minor, build) tuple, which allows reporting 10.1+ > as "post11" and minimizes hard coding of build numbers. For

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

2021-10-07 Thread Eryk Sun
Eryk Sun added the comment: > use the build number as reference instead of the major.minor It could check the (major, minor, build) tuple, which allows reporting 10.1+ as "post11" and minimizes hard coding of build numbers. For example, given win32_ver() iterates by (major, minor, build)

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

2021-10-07 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: Beter solution . Using match in python 3.10 -- Added file: https://bugs.python.org/file50331/main.py ___ Python tracker ___

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

2021-10-07 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: That nice idea . So the dist can contain the minimal build required to say that is for example windows 11 . The simplest solution that came in mind is . Is far from perfect but it works. -- Added file: https://bugs.python.org/file50330/main.py

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

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: It's probably time to extend the marketing version detection mechanism to use the build number as reference instead of the major.minor system version numbers. Here's a good reference for this:

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

2021-10-07 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: systeminfo can be option -- Added file: https://bugs.python.org/file50329/import subprocess.py ___ Python tracker ___

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

2021-10-05 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +eryksun ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-10-05 Thread Steve Dower
Steve Dower added the comment: > Hmm, but the "ver" output seems to have more information than those APIs. It's always had build numbers, which the regular APIs do not, because the regular APIs are meant for detecting incompatibilities rather than reporting. Since there are some

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

2021-10-05 Thread Eryk Sun
Eryk Sun added the comment: The _WIN32_CLIENT_RELEASES table based on major.minor version number isn't helpful since Windows 10 and 11 have the same version number. win32_ver() needs a workaround to return release "11" if the build number is 22000 or greater. Is there any need/desire to

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

2021-10-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 05.10.2021 22:30, Steve Dower wrote: > The version number for "Windows 11" still starts with 10.0. Just like how > Windows 5.x and 6.x were around for a very long time each ;) > > There are tables in platform module that map the specific version to

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

2021-10-05 Thread Steve Dower
Steve Dower added the comment: The version number for "Windows 11" still starts with 10.0. Just like how Windows 5.x and 6.x were around for a very long time each ;) There are tables in platform module that map the specific version to the release name. These probably need to be updated to

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

2021-10-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: win32_ver() should be using the internal Windows APIs to figure out the version. I do wonder why those don't return the same version as the "ver" command line tool. Adding our Windows experts to the noisy list. -- nosy: +lemburg, paul.moore,

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

2021-10-05 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: demo.py contains dirty hack that can be used as a fix for some time before microsoft will not fix it. -- Added file: https://bugs.python.org/file50327/demo.py ___ Python tracker

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

2021-10-05 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: The bug comes from Microsoft terminal bug : If I type there : ver it will return Microsoft Windows [Version 10.0.22000.194] only one patch is if that will check the build . so : info = subprocess.check_output(cmd,

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

2021-10-05 Thread Alex Zaslavskis
Alex Zaslavskis added the comment: The platform.win32_ver() returns same answer -- ___ Python tracker ___ ___ Python-bugs-list

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

2021-10-05 Thread Alex Zaslavskis
New submission from Alex Zaslavskis : I am updated to windows 11 . Now I am trying to write script that will detect is user use windows 11 or windows 10 . I was using the simplest way as possible: import platform print(platform.platform()) The result I got is : Windows-10-10.0.22000-SP0