Resulting document list from `papis.cli.handle_doc_folder_query_sort` being sneakily mutated during iteration
kiike opened this issue · comments
Enric Morales commented
On papis@380e1f13
:
During testing of papis/commands/rename.py
, there's an iteration over the results of handle_doc_folder_query_sort
. If we run()
directly from cli()
, the documents
list will be mutating, possibly trying to execute run
more than once for each document. A workaround was introduced in #810, which passes documents
to another function which then calls run()
. Somehow, this avoids the mutation.
It will be interesting to investigate why the list is mutating so that we can remove the workaround.