Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
The Yocto project has been seeing mysterious build failures that were traced down to stale empty python module directories left behind by previous module versions:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14816
We are carrying the following patch to address the issue (it both ignores the empty directories, and looks at directories in deterministic sorted order):
--- a/Lib/importlib/metadata/__init__.py+++ b/Lib/importlib/metadata/__init__.py@@ -710,7 +710,14 @@ class Lookup: self.infos = FreezableDefaultDict(list) self.eggs = FreezableDefaultDict(list) - for child in path.children():+ for child in sorted(path.children()):+ childpath = pathlib.Path(path.root, child)+ try:+ if childpath.is_dir() and not any(childpath.iterdir()):+ # Empty directories aren't interesting+ continue+ except PermissionError:+ continue low = child.lower() if low.endswith((".dist-info", ".egg-info")): # rpartition is faster than splitext and suitable for this purpose.We'd like to discuss with upstream if such a fix is appropriate and will be taken as a proper pull request.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux