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.
This commit is contained in:
Adrian Sampson 2017-10-20 14:49:53 -04:00
parent db71710fea
commit 14476e2f8a
2 changed files with 4 additions and 1 deletions

View file

@ -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)

View file

@ -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: