Bug 179344

Summary: [Win] The way to detect Windows 10 is wrong
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: Tools / TestsAssignee: 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 Flags
patch
none
fix
none
fix test
none
add test and changelog none

Description Basuke Suzuki 2017-11-06 14:08:02 PST
It falls always 'future'.
Comment 1 Basuke Suzuki 2017-11-06 14:20:33 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.
Comment 2 Fujii Hironori 2017-11-09 21:25:48 PST
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'
> >>>
Comment 3 Basuke Suzuki 2017-11-10 15:59:16 PST
Created attachment 326646 [details]
patch
Comment 4 Basuke Suzuki 2017-11-10 16:00:45 PST
platform.release() seems more straightforward to me.

https://docs.python.org/2/library/platform.html?highlight=platform%20release#platform.release
Comment 5 WebKit Commit Bot 2017-11-10 18:35:56 PST
Comment on attachment 326646 [details]
patch

Clearing flags on attachment: 326646

Committed r224720: <https://trac.webkit.org/changeset/224720>
Comment 6 WebKit Commit Bot 2017-11-10 18:35:58 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2017-11-15 09:42:25 PST
<rdar://problem/35562264>
Comment 8 Basuke Suzuki 2017-12-08 16:45:30 PST
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.
Comment 9 Basuke Suzuki 2017-12-08 17:07:30 PST
Created attachment 328890 [details]
fix

use win32_ver() instead of getwindowsversion()
Comment 10 Basuke Suzuki 2017-12-08 20:58:09 PST
Created attachment 328900 [details]
fix test

modify test
Comment 11 Basuke Suzuki 2017-12-08 21:10:23 PST
Created attachment 328902 [details]
add test and changelog
Comment 12 WebKit Commit Bot 2017-12-08 23:39:50 PST
Comment on attachment 328902 [details]
add test and changelog

Clearing flags on attachment: 328902

Committed r225722: <https://trac.webkit.org/changeset/225722>
Comment 13 WebKit Commit Bot 2017-12-08 23:39:52 PST
All reviewed patches have been landed.  Closing bug.