From deee737660dae264ea01851b6adf2f74d7dbd30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 6 Feb 2019 18:36:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Raise=20no=20exception=20in=20ca?= =?UTF-8?q?se=20of=20missing=20wheel=20metadata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That's normal for plugins that were installed as eggs instead of wheels and we don't want to raise the error in this case. If we also don't find egg metadata we'll log a warning anyhow. Any other exceptions will be raised though. --- src/octoprint/plugin/core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/octoprint/plugin/core.py b/src/octoprint/plugin/core.py index cc4333057..4456f0f9b 100644 --- a/src/octoprint/plugin/core.py +++ b/src/octoprint/plugin/core.py @@ -1658,11 +1658,13 @@ class EntryPointMetadata(pkginfo.Distribution): for metadata_file in metadata_files: try: return self.entry_point.dist.get_metadata(metadata_file) - except Exception: - raise # TODO really ignore this? + except (IOError, OSError): + # file not found, metadata file might be missing, ignore + # IOError: file not found in Py2 + # OSError (specifically FileNotFoundError): file not found in Py3 pass - warnings.warn('No package metadata found for package: {}'.format(self.entry_point.module_name)) + warnings.warn('No package metadata found for package {}'.format(self.entry_point.module_name)) class Plugin(object):