Fix errors caused by .DS_Store files inserted into the .caltrash directory on macOS if the user happens to open .caltrash in Finder. Fixes #2037237 [NotADirectoryError when merging books on MacOS](https://bugs.launchpad.net/calibre/+bug/2037237)

This commit is contained in:
Kovid Goyal 2023-09-25 10:27:23 +05:30
parent 3d045fb230
commit 7bde152ed3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2040,6 +2040,7 @@ class DB:
for base in ('b', 'f'):
base = os.path.join(self.trash_dir, base)
for x in os.scandir(base):
if x.is_dir(follow_symlinks=False):
try:
st = x.stat(follow_symlinks=False)
mtime = st.st_mtime