From 88a0f9b10a334653ed431ef7167b22d1036cc236 Mon Sep 17 00:00:00 2001 From: Marko Jennings Date: Thu, 28 May 2026 22:52:24 -0400 Subject: [PATCH] Fix IndexError in work_process when removing circular-descendant parents When a work has two or more parents that are circular descendants, the removal loop iterated del_list via list(set(...)) (arbitrary order) and called parentIds.pop(i)/parents.pop(i). Each pop shrinks the list, so a later index becomes out of range -> IndexError: pop index out of range. Because this runs inside a QtNetwork reply slot, PyQt escalates the uncaught exception to qFatal()/abort() and Picard crashes. Pop in descending index order so earlier removals do not invalidate later indices. Co-Authored-By: Claude Opus 4.8 (1M context) --- plugins/classical_extras/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/classical_extras/__init__.py b/plugins/classical_extras/__init__.py index 45bca9f8..6128aea3 100644 --- a/plugins/classical_extras/__init__.py +++ b/plugins/classical_extras/__init__.py @@ -4961,7 +4961,7 @@ def work_process(self, workId, tries, response, reply, error): if work_item in self.child_listing and parentId in self.child_listing[ work_item]: del_list.append(i) - for i in list(set(del_list)): + for i in sorted(set(del_list), reverse=True): removed_id = parentIds.pop(i) removed_name = parents.pop(i) write_log(