From a79e933c377a459d8a5642c8d01fa914dc9e0d63 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 6 Jul 2020 14:22:35 +0300 Subject: [PATCH] Ignore author's broken email in a package manifest --- platformio/package/manifest/parser.py | 2 ++ tests/package/test_manifest.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio/package/manifest/parser.py b/platformio/package/manifest/parser.py index d49d7b9c..66dee43c 100644 --- a/platformio/package/manifest/parser.py +++ b/platformio/package/manifest/parser.py @@ -185,6 +185,8 @@ class BaseManifestParser(object): assert isinstance(author, dict) if author.get("email"): author["email"] = re.sub(r"\s+[aA][tT]\s+", "@", author["email"]) + if "@" not in author["email"]: + author["email"] = None for key in list(author.keys()): if author[key] is None: del author[key] diff --git a/tests/package/test_manifest.py b/tests/package/test_manifest.py index 53a31e9b..fe5054d0 100644 --- a/tests/package/test_manifest.py +++ b/tests/package/test_manifest.py @@ -279,7 +279,7 @@ ignore_empty_field= # Author + Maintainer data = parser.LibraryPropertiesManifestParser( """ -author=Rocket Scream Electronics +author=Rocket Scream Electronics maintainer=Rocket Scream Electronics """ ).as_dict()