[path] treat broken symlinks as existing files (#8490)

This commit is contained in:
Mike Fährmann
2025-10-31 21:03:53 +01:00
parent a3734e2e56
commit 3848a912dc

View File

@@ -162,7 +162,7 @@ class PathFormat():
"""Return True if the file exists on disk"""
if self.extension:
try:
os.stat(self.realpath) # raises OSError if file doesn't exist
os.lstat(self.realpath) # raises OSError if file doesn't exist
return self.check_file()
except OSError:
pass
@@ -178,7 +178,7 @@ class PathFormat():
prefix = format(num) + "."
self.kwdict["extension"] = prefix + self.extension
self.build_path()
os.stat(self.realpath) # raises OSError if file doesn't exist
os.lstat(self.realpath) # raises OSError if file doesn't exist
num += 1
except OSError:
pass