From f25ef1ed2a4c8baf8da682081c12a961005686e5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 21 Jul 2025 19:33:36 +0530 Subject: [PATCH] When importing exported calibre data ignore "Appledouble" files created by macOS if the user copies the exported data onto a non-native filesystem using macOS tools --- src/calibre/utils/exim.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/exim.py b/src/calibre/utils/exim.py index 92e8be0a56..657ec68205 100644 --- a/src/calibre/utils/exim.py +++ b/src/calibre/utils/exim.py @@ -366,7 +366,9 @@ class Importer: self.tail_size = tail_size = struct.calcsize(Exporter.TAIL_FMT) self.version = -1 for name in os.listdir(path_to_export_dir): - if name.lower().endswith(Exporter.EXT): + # Exclude the "appledouble" files created by macOS. + # See https://bugs.launchpad.net/calibre/+bug/2117345 + if name.lower().endswith(Exporter.EXT) and not name.startswith('._'): path = os.path.join(path_to_export_dir, name) with open(path, 'rb') as f: f.seek(0, os.SEEK_END)