Skip to content

Commit 94dae3d

Browse files
willynillyproycon
authored andcommitted
Fixes parsing author and maintainer name from quotations after importlib.metadata is used.
1 parent 313998b commit 94dae3d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

codemeta/parsers/python.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ def parse_python(
313313
add_authors(
314314
g,
315315
res,
316-
value=pkg.metadata.get("Author-email", "").rsplit("<")[0],
316+
value=(pkg.metadata.get("Author-email", "").rsplit("<")[0])
317+
.strip()
318+
.removeprefix('"')
319+
.removesuffix('"'),
317320
single_author=True,
318321
mail=pkg.metadata.get("Author-email", "")
319322
.rsplit("<")[-1]
@@ -348,7 +351,10 @@ def parse_python(
348351
add_authors(
349352
g,
350353
res,
351-
value=pkg.metadata.get("Maintainer-email", "").rsplit("<")[0],
354+
value=(pkg.metadata.get("Maintainer-email", "").rsplit("<")[0])
355+
.strip()
356+
.removeprefix('"')
357+
.removesuffix('"'),
352358
single_author=True,
353359
mail=pkg.metadata.get("Maintainer-email", "")
354360
.rsplit("<")[-1]

0 commit comments

Comments
 (0)