diff --git a/tools/memory_tool.py b/tools/memory_tool.py index eef64e709669b..b7d1af0d15fbb 100644 --- a/tools/memory_tool.py +++ b/tools/memory_tool.py @@ -417,6 +417,9 @@ def _read_file(path: Path) -> List[str]: return [] try: raw = path.read_text(encoding="utf-8") + # Strip UTF-8 BOM if present (common when files are edited on Windows) + if raw.startswith("\ufeff"): + raw = raw[1:] except (OSError, IOError): return []