A feature-rich command-line audio/video downloader
[plugins] Handle `PermissionError` (#9229)
Jade Laurence Empleo9a8afadd172b
diff --git a/yt_dlp/plugins.py b/yt_dlp/plugins.pyindex 6422c7a51d..3cc879fd7e 100644--- a/yt_dlp/plugins.py+++ b/yt_dlp/plugins.py@@ -86,11 +86,14 @@ class PluginFinder(importlib.abc.MetaPathFinder):parts = Path(*fullname.split('.'))for path in orderedSet(candidate_locations, lazy=True):candidate = path / parts- if candidate.is_dir():- yield candidate- elif path.suffix in ('.zip', '.egg', '.whl') and path.is_file():- if parts in dirs_in_zip(path):+ try:+ if candidate.is_dir():yield candidate+ elif path.suffix in ('.zip', '.egg', '.whl') and path.is_file():+ if parts in dirs_in_zip(path):+ yield candidate+ except PermissionError as e:+ write_string(f'Permission error while accessing modules in "{e.filename}"\n')def find_spec(self, fullname, path=None, target=None):if fullname not in self.packages: