You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that hook.py uses subprocess.Popen(command_pieces).wait() (BTW, why not subprocess.call), and does not check the return code (you ignore the wait result). It also might be you thought this code does what check_call does (namely, throw on non-OK exit). Right now, your exception handler is only triggered when the command cannot be found.
An improvement would be to log a warning on non-OK exit code, and allow failing commands to exit the beets process. Example:
I wouldn't mind looking into this, however I'm not quite sure how the skip functionality would work. Do you have any specific events in mind for the skip operations @jhermann? The only tasks I can see which it would really work for are import_task_created and maybe a few of the other import_task_* events.
Similarly, how would abort work? Would it just throw an exception to force beets to exit? It seems like most events don't provide any cancellation functionality, so that looks like it might be the only way to do it.
Would ignore stop logging errors? If so then we should probably default to log which is what we do right now.
Do you have any specific events in mind for the skip operations @jhermann? The only tasks I can see which it would really work for are import_task_created and maybe a few of the other import_task_* events.
old issue, but yeah, this would be relevant to avoid messing around with files that are handled by another manager, say a torrent client (#2617).
I noticed that
hook.py
usessubprocess.Popen(command_pieces).wait()
(BTW, why notsubprocess.call
), and does not check the return code (you ignore thewait
result). It also might be you thought this code does whatcheck_call
does (namely, throw on non-OK exit). Right now, your exception handler is only triggered when the command cannot be found.An improvement would be to log a warning on non-OK exit code, and allow failing commands to exit the beets process. Example:
Choices for
on_error
would beabort
,ignore
(the default),log
,skip_album
, andskip_item
.skip_*
would depend on the event, e.g. skip an album import if the command fails.The text was updated successfully, but these errors were encountered: