Skip to content

Bug when using ID-list #57

@eclake

Description

@eclake

for i, (ID, file) in enumerate(zip(IDs, file_list)):
if args.ID_list is not None:
if not ID in args.ID_list:
IDs.remove(ID)
file_list.remove(file)
continue
if regex is not None:
_ID = regex.sub("", ID)
IDs[i] = _ID

The IDs and file_list variables are being dynamically changed while also iterating over them which doesn't lead to the desired effect

Suggested fix:
import copy

Then at the lines above

IDs_copy = copy.deepcopy(IDs)
file_list_copy = copy.deepcopy(file_list)
for i, (ID, file) in enumerate(zip(IDs_copy, file_list_copy))

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions