fix(maintenance): stat duplicate candidates with os.stat

Python 3.10's Path.stat uses the os.stat bound when pathlib was imported,
so the find and the per-file checks could see different stat calls. The
find now calls os.stat directly, like every other check; the mount tests
failed on py3.10 only.
This commit is contained in:
Vito Sansevero
2026-10-23 20:24:49 -07:00
parent 2b5a945c4d
commit c9f78fac58
+3 -1
View File
@@ -776,7 +776,9 @@ class AdminRoutesMixin:
for slot, root in enumerate(roots):
for path in _collect_media_files([root], extensions):
try:
stat = path.stat()
# os.stat, not Path.stat: one stat call for every check
# (Python 3.10's Path.stat bypasses a patched os.stat).
stat = os.stat(path)
except OSError:
continue
key = _physical_file_key(path, stat)