Summary: | [Win] The way to detect Windows 10 is wrong | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Basuke Suzuki <Basuke.Suzuki> | ||||||||||
Component: | Tools / Tests | Assignee: | Basuke Suzuki <Basuke.Suzuki> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | achristensen, Basuke.Suzuki, bfulgham, buildbot, commit-queue, don.olmstead, glenn, Hironori.Fujii, lforschler, pvollan, rniwa, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 179216 | ||||||||||||
Attachments: |
|
Description
Basuke Suzuki
2017-11-06 14:08:02 PST
> $ python2
> ActivePython 2.7.13.2716 (ActiveState Software Inc.) based on
> Python 2.7.13 (default, Jun 26 2017, 14:28:43) [MSC v.1500 64 bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> sys.getwindowsversion()
> sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='')
Windows python2 doesn't return correct information :(
(It should be major=10, minor=10, build=1xxxx).
python3 returns correct information.
This issue has been addressed in Python 2. https://hg.python.org/cpython/rev/d8453733cc0c We need to use platform.version() instead of sys.getwindowsversion(). > C:\>ver > > Microsoft Windows [Version 10.0.14393] > > C:\>python > ActivePython 2.7.13.2716 (ActiveState Software Inc.) based on > Python 2.7.13 (default, Jun 26 2017, 14:28:43) [MSC v.1500 64 bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import sys > >>> sys.getwindowsversion() > sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='') > >>> import platform > >>> platform.version() > '10.0.14393' > >>> Created attachment 326646 [details]
patch
platform.release() seems more straightforward to me. https://docs.python.org/2/library/platform.html?highlight=platform%20release#platform.release Comment on attachment 326646 [details] patch Clearing flags on attachment: 326646 Committed r224720: <https://trac.webkit.org/changeset/224720> All reviewed patches have been landed. Closing bug. Windows 10 is not detected correctly again after Version standardize refactoring. The issue is getwindowsversion() doesn't return correct answer on Python2.7 on Windows. We should use win32_ver()[1] which is same result with `ver` command. Created attachment 328890 [details]
fix
use win32_ver() instead of getwindowsversion()
Created attachment 328900 [details]
fix test
modify test
Created attachment 328902 [details]
add test and changelog
Comment on attachment 328902 [details] add test and changelog Clearing flags on attachment: 328902 Committed r225722: <https://trac.webkit.org/changeset/225722> All reviewed patches have been landed. Closing bug. |