NEW 284088
[AutoInstall] don't mutate sys.path
https://bugs.webkit.org/show_bug.cgi?id=284088
Summary [AutoInstall] don't mutate sys.path
Sam Sneddon [:gsnedders]
Reported 2024-12-04 20:29:03 PST
There shouldn't be any need to mutate sys.path at all; this actually leads to a kinda weird interaction between where the AutoInstaller lives on sys.meta_path and where the AutoInstaller has added directories on sys.path. Our importlib.abc.MetaPathFinder.find_spec should just return a spec that suffices to load the module, and thus no sys.path modification should be necessary. We can probably even delegate most of the actual implementation to importlib.machinery.FileFinder. Note that if we stop mutating sys.path, we should _also_ make sure we also implement DistributionFinder.find_distributions so importlib.metadata can continue to find distribution metadata.
Attachments
Radar WebKit Bug Importer
Comment 1 2024-12-11 20:30:16 PST
Note You need to log in before you can comment on or make changes to this bug.