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.
<rdar://problem/82006256>
Created attachment 435650 [details] Patch
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)
(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
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?
(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
Created attachment 435704 [details] Patch
Found 1 new test failure: imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html
Committed r281167 (240614@main): <https://commits.webkit.org/240614@main>