From 2199fcc851b139fa21cec9ed2ab3ee85c952c897 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 23 Aug 2026 13:35:52 -0500 Subject: [PATCH] Restore the malformed-manifest raises lost in the merge resolution --- esphome/platformio/library.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esphome/platformio/library.py b/esphome/platformio/library.py index 22e122dd28..9840e907bf 100644 --- a/esphome/platformio/library.py +++ b/esphome/platformio/library.py @@ -463,6 +463,9 @@ def check_library_data(data: dict, platform: str | None, framework: str): if isinstance(platforms, str): platforms = [a.strip() for a in platforms.split(",")] platforms = ensure_list(platforms) + if not all(isinstance(pf, str) for pf in platforms): + # A real (non-platform) manifest problem; callers warn, not skip + raise InvalidLibrary(f"Malformed platforms value: {platforms!r}") # Check if library supports the target platform valid_platforms = platform is None or "*" in platforms or platform in platforms @@ -474,6 +477,8 @@ def check_library_data(data: dict, platform: str | None, framework: str): if isinstance(frameworks, str): frameworks = [a.strip() for a in frameworks.split(",")] frameworks = ensure_list(frameworks) + if not all(isinstance(fw, str) for fw in frameworks): + raise InvalidLibrary(f"Malformed frameworks value: {frameworks!r}") # Check if library declares the active framework. PIO library manifests # often list only "arduino" even when the library actually compiles fine