summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-08 21:24:40 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-08 21:24:40 -0500
commit91afe3b30dd32d439ab8914ba3a80bbe2d9f293c (patch)
treeb7387ab0bc36f1b1b8d019a78b3f941b0b5ef8ae
parent434d573a2d4d1c7b00d36f8c4f8b5c4b64b46e63 (diff)
downloadpython-setuptools-git-91afe3b30dd32d439ab8914ba3a80bbe2d9f293c.tar.gz
Avoid errors when metadata directory is broken. Ref #419.
-rw-r--r--CHANGES.txt2
-rw-r--r--pkg_resources/__init__.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index bacace8d..a48cd3e1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,8 @@ CHANGES
* Issue #471: Don't rely on repr for an HTML attribute value in
package_index.
+* Issue #419: Avoid errors in FileMetadata when the metadata directory
+ is broken.
------
18.7.1
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 3cd67fa0..2cb851b1 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2017,7 +2017,7 @@ class FileMetadata(EmptyProvider):
self.path = path
def has_metadata(self, name):
- return name=='PKG-INFO'
+ return name=='PKG-INFO' and os.path.isfile(self.path)
def get_metadata(self, name):
if name=='PKG-INFO':