From c9f78fac589667852ac674dc69dcc2da34350cc1 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Fri, 23 Oct 2026 20:24:49 -0700 Subject: [PATCH] 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. --- py/api/admin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py/api/admin.py b/py/api/admin.py index 19487f23..717735ed 100644 --- a/py/api/admin.py +++ b/py/api/admin.py @@ -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)