WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 229172
[webkitcorepy] Return SourceFileLoader in find_module
https://bugs.webkit.org/show_bug.cgi?id=229172
Summary
[webkitcorepy] Return SourceFileLoader in find_module
Jonathan Bedard
Reported
2021-08-16 17:33:18 PDT
On some of our bots, Python 3 scripts are failing because the auto installer is failing to load modules it has installed. This is because we aren't implementing everything required for a custom import system, namely, we should return a module loader. Python 2 doesn't require this, and implementing a module loader in Python 2 is non trivial, and we intend to deprecate Python 2 in the near future.
Attachments
Patch
(3.94 KB, patch)
2021-08-16 17:35 PDT
,
Jonathan Bedard
no flags
Details
Formatted Diff
Diff
Patch
(3.93 KB, patch)
2021-08-17 13:07 PDT
,
Jonathan Bedard
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-08-16 17:33:38 PDT
<
rdar://problem/82006256
>
Jonathan Bedard
Comment 2
2021-08-16 17:35:47 PDT
Created
attachment 435650
[details]
Patch
Stephanie Lewis
Comment 3
2021-08-17 12:13:21 PDT
I don't think we can claim we can deprecate python2 until we stop testing on macOS 10 (at least for stuff engineers might use, I don't care about infra)
Jonathan Bedard
Comment 4
2021-08-17 12:22:28 PDT
(In reply to Stephanie Lewis from
comment #3
)
> I don't think we can claim we can deprecate python2 until we stop testing on > macOS 10 (at least for stuff engineers might use, I don't care about infra)
That's what's weird about this particular case. Python 2 doesn't seem to need it (which is why we aren't having this problem on the bots now). Actually, even Python 3 doesn't seem to always need it in practice, although I'm not entirely sure why, because Python 3's documentation indicates that we always need this. I did look into a Python 2 implementation, but we need SourceFileLoader, which isn't trivial to upload. Since it doesn't seem like we need this in practice, this code works just fine right now with Python 2, I think we can get away with a Python 3 only implementation
Stephanie Lewis
Comment 5
2021-08-17 12:33:47 PDT
Comment on
attachment 435650
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=435650&action=review
> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:603 > + # Python 2 works find with the default module finder, once we've installed the module in question
typo fine
> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:609 > + for trail in ('', '.py', '.pyc', '.py3', '.pyo'):
would ext be a better name than trail?
> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:614 > + if not os.path.isdir(part):
do you mean path here?
Jonathan Bedard
Comment 6
2021-08-17 12:37:44 PDT
(In reply to Stephanie Lewis from
comment #5
)
> Comment on
attachment 435650
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=435650&action=review
> > > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:603 > > + # Python 2 works find with the default module finder, once we've installed the module in question > > typo fine > > > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:609 > > + for trail in ('', '.py', '.pyc', '.py3', '.pyo'): > > would ext be a better name than trail?
Yes
> > > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:614 > > + if not os.path.isdir(part): > > do you mean path here?
Yes
Jonathan Bedard
Comment 7
2021-08-17 13:07:53 PDT
Created
attachment 435704
[details]
Patch
EWS
Comment 8
2021-08-17 14:58:02 PDT
Found 1 new test failure: imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html
Jonathan Bedard
Comment 9
2021-08-17 15:16:22 PDT
Committed
r281167
(
240614@main
): <
https://commits.webkit.org/240614@main
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug