From a3323d74d4eedb2b2f8d7df150e1ac53fdaa17cf Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 26 Jun 2023 09:43:41 -0700 Subject: [PATCH] list the enumerate --- kindlecomicconverter/comic2ebook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index da6f5e52..3f2b5f88 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -746,7 +746,8 @@ def getPanelViewSize(deviceres, size): def sanitizeTree(filetree): chapterNames = {} for root, dirs, files in os.walk(filetree, False): - for i, name in enumerate(files): + # only iterate over original files before renaming + for i, name in list(enumerate(files)): splitname = os.path.splitext(name) newKey = os.path.join(root, f'{i:04}' + splitname[1]) key = os.path.join(root, name)