]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[bpo-45765] Fix distribution discovery on empty path. (#29487)
authorJason R. Coombs <jaraco@jaraco.com>
Tue, 9 Nov 2021 23:49:43 +0000 (18:49 -0500)
committerGitHub <noreply@github.com>
Tue, 9 Nov 2021 23:49:43 +0000 (18:49 -0500)
Lib/importlib/metadata/__init__.py
Misc/NEWS.d/next/Library/2021-11-09-09-04-19.bpo-45765.JVobxK.rst [new file with mode: 0644]

index f5172eefc184111414f4ec0c26d8f897e0fb105c..b3e8fb05f1d985cf7ad4a1f4645a91aaf00dac98 100644 (file)
@@ -748,7 +748,7 @@ class FastPath:
 
     def children(self):
         with suppress(Exception):
-            return os.listdir(self.root or '')
+            return os.listdir(self.root or '.')
         with suppress(Exception):
             return self.zip_children()
         return []
diff --git a/Misc/NEWS.d/next/Library/2021-11-09-09-04-19.bpo-45765.JVobxK.rst b/Misc/NEWS.d/next/Library/2021-11-09-09-04-19.bpo-45765.JVobxK.rst
new file mode 100644 (file)
index 0000000..a1f4a1f
--- /dev/null
@@ -0,0 +1 @@
+In importlib.metadata, fix distribution discovery for an empty path.