From 14476e2f8a4148a66dfe9f627c97dabd8ea31833 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 20 Oct 2017 14:49:53 -0400 Subject: [PATCH] scrub: Handle MutagenError (fix #2716) In older versions of Mutagen, an IOError indicated things like permissions errors. Now, a custom MutagenError is raised. Now we handle both. --- beetsplug/scrub.py | 3 ++- docs/changelog.rst | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/scrub.py b/beetsplug/scrub.py index b652fa2f5..be6e7fd1f 100644 --- a/beetsplug/scrub.py +++ b/beetsplug/scrub.py @@ -24,6 +24,7 @@ from beets import ui from beets import util from beets import config from beets import mediafile +import mutagen _MUTAGEN_FORMATS = { 'asf': 'ASF', @@ -106,7 +107,7 @@ class ScrubPlugin(BeetsPlugin): for tag in f.keys(): del f[tag] f.save() - except IOError as exc: + except (IOError, mutagen.MutagenError) as exc: self._log.error(u'could not scrub {0}: {1}', util.displayable_path(path), exc) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3e167b6c2..07d2dff74 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -63,6 +63,8 @@ Fixes: ignored. * :doc:`/plugins/replaygain`: Fix album replaygain calculation with the gstreamer backend. :bug:`2636` +* :doc:`/plugins/scrub`: Handle errors when manipulating files using newer + versions of Mutagen. :bug:`2716` For developers: