From bbb63c605d7db3e18d88566d40807e3eeff643b7 Mon Sep 17 00:00:00 2001 From: bk86a <41694587+bk86a@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:29:05 +0100 Subject: [PATCH] fix: add csv.Error to _load_estimates_from_csv exception handling Malformed CSV files (NUL bytes, parser corruption) would bubble up and crash startup instead of logging a warning and continuing without estimates. Restores graceful degradation for this optional input path. --- app/data_loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data_loader.py b/app/data_loader.py index 47209e6..eb024d3 100644 --- a/app/data_loader.py +++ b/app/data_loader.py @@ -496,7 +496,7 @@ def _load_estimates_from_csv(csv_path: Path) -> bool: if count: logger.info("Loaded %d estimates from %s", count, csv_path) return count > 0 - except (OSError, KeyError, ValueError) as exc: + except (OSError, KeyError, ValueError, csv.Error) as exc: logger.warning("Failed to load estimates from CSV: %s", exc) return False