Bug 206856 - Python 3: Update windows scripts and uses of is constant
Summary: Python 3: Update windows scripts and uses of is constant
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: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-27 17:16 PST by Stephan Szabo
Modified: 2020-01-28 09:02 PST (History)
5 users (show)

See Also:


Attachments
Patch (9.01 KB, patch)
2020-01-27 17:19 PST, Stephan Szabo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Szabo 2020-01-27 17:16:23 PST
The requirements download script used for wincairo was having problems on python 3.

While working with that, hit error in port/win.py when trying to run check-webkit-style on windows with python 3 and a few more cases that used "is <constant>" that now give SyntaxWarnings.
Comment 1 Stephan Szabo 2020-01-27 17:19:49 PST
Created attachment 388946 [details]
Patch
Comment 2 Jonathan Bedard 2020-01-27 17:40:54 PST
Comment on attachment 388946 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388946&action=review

> Tools/Scripts/download-github-release.py:-30
> -import urllib2

We clearly don't have test coverage here. Do you know who uses this script?

> Tools/Scripts/webkitpy/common/system/profiler.py:175
> +        if exit_code != 0:

What sort of linter are you running to find these? Is that a Python 3.8 thing?

If so, would you mind run 'test-webkitpy-python3' and fixing everything it flags in a separate patch?
Comment 3 Stephan Szabo 2020-01-27 17:53:22 PST
(In reply to Jonathan Bedard from comment #2)
> Comment on attachment 388946 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=388946&action=review
> 
> > Tools/Scripts/download-github-release.py:-30
> > -import urllib2
> 
> We clearly don't have test coverage here. Do you know who uses this script?

Wincairo's update-webkit-wincairo-libs.py script is the only current user.

> > Tools/Scripts/webkitpy/common/system/profiler.py:175
> > +        if exit_code != 0:
> 
> What sort of linter are you running to find these? Is that a Python 3.8
> thing?

I think it's a syntax warning (on loading the file?) that was added in 3.8.

> If so, would you mind run 'test-webkitpy-python3' and fixing everything it
> flags in a separate patch?

test-webkitpy-python3 was how I hit most of the "is XXX" ones in this patch. I didn't cover anything that was in thirdparty, but I think I hit all the ones apart from that, but I'll check to see if I missed anything.
Comment 4 Jonathan Bedard 2020-01-28 08:18:09 PST
(In reply to Stephan Szabo from comment #3)
> (In reply to Jonathan Bedard from comment #2)
> > Comment on attachment 388946 [details]
> > Patch
> > 
> > ...
> >
> > What sort of linter are you running to find these? Is that a Python 3.8
> > thing?
> 
> I think it's a syntax warning (on loading the file?) that was added in 3.8.
> 
> > If so, would you mind run 'test-webkitpy-python3' and fixing everything it
> > flags in a separate patch?
> 
> test-webkitpy-python3 was how I hit most of the "is XXX" ones in this patch.
> I didn't cover anything that was in thirdparty, but I think I hit all the
> ones apart from that, but I'll check to see if I missed anything.

Surprised that there are so few!

We might eventually need to update third party libraries to ones that advertise themselves as 3.8 compatible, but that's not an urgent task.
Comment 5 WebKit Commit Bot 2020-01-28 09:01:57 PST
Comment on attachment 388946 [details]
Patch

Clearing flags on attachment: 388946

Committed r255243: <https://trac.webkit.org/changeset/255243>
Comment 6 WebKit Commit Bot 2020-01-28 09:01:58 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2020-01-28 09:02:15 PST
<rdar://problem/58957042>