Bug 179344 - [Win] The way to detect Windows 10 is wrong
Summary: [Win] The way to detect Windows 10 is wrong
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 179216
  Show dependency treegraph
 
Reported: 2017-11-06 14:08 PST by Basuke Suzuki
Modified: 2017-12-08 23:39 PST (History)
12 users (show)

See Also:


Attachments
patch (1.14 KB, patch)
2017-11-10 15:59 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff
fix (2.85 KB, patch)
2017-12-08 17:07 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff
fix test (6.60 KB, patch)
2017-12-08 20:58 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff
add test and changelog (7.75 KB, patch)
2017-12-08 21:10 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.