mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 08:20:21 +00:00
Classify a truncated size report as a corrupt artifact
UnicodeDecodeError is a ValueError, so a non-UTF-8 esp_idf_size.json read as an internal regression via the backstop; the size report is the one input nothing upstream validates.
This commit is contained in:
@@ -107,7 +107,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):
|
||||
|
||||
Reference in New Issue
Block a user