mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[plugins] Handle PermissionError (#9229)
				
					
				
			Authored by: syntaxsurge, pukkandan
This commit is contained in:
		 Jade Laurence Empleo
					Jade Laurence Empleo
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							104a7b5a46
						
					
				
				
					commit
					9a8afadd17
				
			| @@ -86,11 +86,14 @@ class PluginFinder(importlib.abc.MetaPathFinder): | |||||||
|         parts = Path(*fullname.split('.')) |         parts = Path(*fullname.split('.')) | ||||||
|         for path in orderedSet(candidate_locations, lazy=True): |         for path in orderedSet(candidate_locations, lazy=True): | ||||||
|             candidate = path / parts |             candidate = path / parts | ||||||
|             if candidate.is_dir(): |             try: | ||||||
|                 yield candidate |                 if candidate.is_dir(): | ||||||
|             elif path.suffix in ('.zip', '.egg', '.whl') and path.is_file(): |  | ||||||
|                 if parts in dirs_in_zip(path): |  | ||||||
|                     yield candidate |                     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): |     def find_spec(self, fullname, path=None, target=None): | ||||||
|         if fullname not in self.packages: |         if fullname not in self.packages: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user