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:
+3
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user