From be12661f3828cefa494a5173c2910cfca66a3ff5 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 26 Jul 2025 07:14:54 -0700 Subject: [PATCH] only flatten super long paths on Windows --- kindlecomicconverter/comic2ebook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 04115c9..a5ccc6e 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -1052,8 +1052,8 @@ def chunk_directory(path): level = -1 for root, _, files in os.walk(os.path.join(path, 'OEBPS', 'Images')): for f in files: - # Windows MAX_LENGTH = 260 plus some buffer - if len(os.path.join(root, f)) > 180: + # Windows MAX_LEN = 260 plus some buffer + if os.name == 'nt' and len(os.path.join(root, f)) > 180: flattenTree(os.path.join(path, 'OEBPS', 'Images')) level = 1 break