diff --git a/src/calibre/gui2/tweak_book/file_list.py b/src/calibre/gui2/tweak_book/file_list.py index 6f0caa489f..90af38b6b2 100644 --- a/src/calibre/gui2/tweak_book/file_list.py +++ b/src/calibre/gui2/tweak_book/file_list.py @@ -312,7 +312,7 @@ class FileList(QTreeWidget): return parts = name.split('/') - text = parts[-1] + text = parts.pop() while text in seen and parts: text = parts.pop() + '/' + text seen[text] = item