From 8da2b4cb9614e75fc00ba3e202569fe8ca7f3fe4 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 25 May 2025 11:32:41 -0700 Subject: [PATCH] ignore ._ files for real --- kindlecomicconverter/comic2ebook.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index c70450d..e169cbf 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -836,6 +836,10 @@ def sanitizePermissions(filetree): os.chmod(os.path.join(root, name), S_IWRITE | S_IREAD) for name in dirs: os.chmod(os.path.join(root, name), S_IWRITE | S_IREAD | S_IEXEC) + for root, dirs, files in os.walk(filetree, False): + for name in files: + if name.startswith('._'): + os.remove(os.path.join(root, name)) def chunk_directory(path): @@ -940,7 +944,8 @@ def detectSuboptimalProcessing(tmppath, orgpath): raise RuntimeError('Image file %s is corrupted. Error: %s' % (pathOrg, str(err))) else: try: - os.remove(os.path.join(root, name)) + if os.path.exists(os.path.join(root, name)): + os.remove(os.path.join(root, name)) except OSError as e: raise RuntimeError(f"{name}: {e}") # remove empty nested folders