From 8a9bb7741a5ecfa5b36b9134294a955d7ec7cfd1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 23 Aug 2026 15:58:52 -0500 Subject: [PATCH] Mirror the truncated-size-report classification --- esphome/espidf/size_summary.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/espidf/size_summary.py b/esphome/espidf/size_summary.py index 4f9e4be6b4..ca3fbf94bd 100644 --- a/esphome/espidf/size_summary.py +++ b/esphome/espidf/size_summary.py @@ -97,7 +97,8 @@ def _print_summary(size_json: Path, partitions_csv: Path | None) -> None: # FileNotFoundError lands in the OSError arm with the path in its text. try: data = json.loads(size_json.read_text(encoding="utf-8")) - except (OSError, json.JSONDecodeError) as e: + except (OSError, ValueError) as e: + # ValueError covers JSONDecodeError and a non-UTF-8 (truncated) file _LOGGER.warning("Skipping size summary: %s", e) return if not isinstance(data, dict):