From 1025c612b27763aa11849ed347171407b1572217 Mon Sep 17 00:00:00 2001 From: KeelrLeek <156356974+KeelrLeek@users.noreply.github.com> Date: Tue, 6 Oct 2026 13:15:05 -0500 Subject: [PATCH] queue: skip a source file that a landing moves or rewrites mid-scan instead of crashing next_functions --- harbor/queue.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/harbor/queue.py b/harbor/queue.py index 4c69984..1949c22 100644 --- a/harbor/queue.py +++ b/harbor/queue.py @@ -47,8 +47,12 @@ class FunctionQueue: m = re.match(r"([0-9A-F]{6,8})_", path.name) if not m: continue - with path.open(encoding="utf-8", errors="replace") as f: - head = [next(f, "") for _ in range(8)] + try: + with path.open(encoding="utf-8", errors="replace") as f: + head = [next(f, "") for _ in range(8)] + except (FileNotFoundError, PermissionError): + continue # a landing on main moved or rewrote it while we scanned; its new path is found + status = "readable" if any(line.startswith(READABLE) for line in head) else \ next((line.split("status:", 1)[1].strip() for line in head if "status:" in line), "raw") out[int(m.group(1), 16)] = (status, path.name)