filesystem: in recursive mtime, check only files that exist (#32175)

* filesystem: use lstat in recursive mtime

When a `develop` path contains a dead symlink, the `os.stat` in the recursive `mtime` determination trips up over it.

Closes #32165.
This commit is contained in:
Wouter Deconinck
2022-08-16 16:06:31 -05:00
committed by GitHub
parent 7e1890772c
commit 8f34a3ac5c

View File

@@ -1293,7 +1293,7 @@ def last_modification_time_recursive(path):
path = os.path.abspath(path)
times = [os.stat(path).st_mtime]
times.extend(
os.stat(os.path.join(root, name)).st_mtime
os.lstat(os.path.join(root, name)).st_mtime
for root, dirs, files in os.walk(path)
for name in dirs + files
)