aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 82a35702..d463945f 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -1987,11 +1987,11 @@ 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':
- with io.open(self.path, 'rU', encoding='utf-8') as f:
+ with io.open(self.path, encoding='utf-8') as f:
metadata = f.read()
return metadata
raise KeyError("No metadata except PKG-INFO is available")