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, 3 insertions, 1 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 2a053b50..b402ddd6 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -1859,7 +1859,9 @@ class FileMetadata(EmptyProvider):
def get_metadata(self, name):
if name=='PKG-INFO':
- with io.open(self.path, encoding='utf-8') as f:
+ env_key = 'PKG_RESOURCES_METADATA_ERRORS'
+ errors = os.environ.get(env_key, 'strict')
+ with io.open(self.path, encoding='utf-8', errors=errors) as f:
try:
metadata = f.read()
except UnicodeDecodeError as exc: