mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
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
This commit is contained in:
parent
5a1ca6edf4
commit
f25ef1ed2a
@ -366,7 +366,9 @@ class Importer:
|
|||||||
self.tail_size = tail_size = struct.calcsize(Exporter.TAIL_FMT)
|
self.tail_size = tail_size = struct.calcsize(Exporter.TAIL_FMT)
|
||||||
self.version = -1
|
self.version = -1
|
||||||
for name in os.listdir(path_to_export_dir):
|
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)
|
path = os.path.join(path_to_export_dir, name)
|
||||||
with open(path, 'rb') as f:
|
with open(path, 'rb') as f:
|
||||||
f.seek(0, os.SEEK_END)
|
f.seek(0, os.SEEK_END)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user