Compare commits

...

1 Commits

Author SHA1 Message Date
Stefan Agner
fb0d7db5e1 Handle OSError in get_latest_mtime during directory walk
Catch OSError when statting files during the recursive directory
walk. This handles cases like symbolic link loops or other filesystem
issues in local add-on directories without crashing the store load.

Fixes SUPERVISOR-1FJ0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 19:14:54 +01:00

View File

@@ -146,9 +146,8 @@ def get_latest_mtime(directory: Path) -> tuple[float, Path]:
if mtime > latest_mtime:
latest_mtime = mtime
latest_path = path
except FileNotFoundError:
# File might disappear between listing and stat. Parent
# directory modification date will flag such a change.
except OSError:
_LOGGER.debug("Could not stat %s, skipping", path)
continue
return latest_mtime, latest_path