From aa7e619f058ce0303328aa119a051bfcb6ca3996 Mon Sep 17 00:00:00 2001 From: Will Riley Date: Thu, 24 Apr 2025 12:06:42 +0200 Subject: [PATCH] Fixes parsing author and maintainer name from quotations after importlib.metadata is used. --- codemeta/parsers/python.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/codemeta/parsers/python.py b/codemeta/parsers/python.py index 23c9354..9687706 100644 --- a/codemeta/parsers/python.py +++ b/codemeta/parsers/python.py @@ -313,7 +313,10 @@ def parse_python( add_authors( g, res, - value=pkg.metadata.get("Author-email", "").rsplit("<")[0], + value=(pkg.metadata.get("Author-email", "").rsplit("<")[0]) + .strip() + .removeprefix('"') + .removesuffix('"'), single_author=True, mail=pkg.metadata.get("Author-email", "") .rsplit("<")[-1] @@ -348,7 +351,10 @@ def parse_python( add_authors( g, res, - value=pkg.metadata.get("Maintainer-email", "").rsplit("<")[0], + value=(pkg.metadata.get("Maintainer-email", "").rsplit("<")[0]) + .strip() + .removeprefix('"') + .removesuffix('"'), single_author=True, mail=pkg.metadata.get("Maintainer-email", "") .rsplit("<")[-1]