From 2f053b0ecd681f7daf654081776b3b7703e59205 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 10 Jun 2013 16:06:43 -0700 Subject: [PATCH] scrub: handle IOError Mutagen can raise this error when trying to truncate a file. --- beetsplug/scrub.py | 5 +++++ docs/changelog.rst | 1 + 2 files changed, 6 insertions(+) diff --git a/beetsplug/scrub.py b/beetsplug/scrub.py index f69e3abf1..1a95c222e 100644 --- a/beetsplug/scrub.py +++ b/beetsplug/scrub.py @@ -108,6 +108,11 @@ def _scrub(path): # remove them. In this case, we just remove all the tags. for tag in f.keys(): del f[tag] + except IOError as exc: + log.error(u'could not scrub {0}: {1}'.format( + util.displayable_path(path), + exc, + )) f.save() # Automatically embed art into imported albums. diff --git a/docs/changelog.rst b/docs/changelog.rst index 5f7ce39cc..3baf66585 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -36,6 +36,7 @@ And some bug fixes: Intzoglou. * Fix an occasional crash in the :doc:`/plugins/beatport` when a length field was missing from the API response. Thanks to Timothy Appnel. +* :doc:`/plugins/scrub`: Handle and log I/O errors. 1.2.0 (June 5, 2013)