Skip to content

Commit

Permalink
scrub: Handle MutagenError (fix #2716)
Browse files Browse the repository at this point in the history
In older versions of Mutagen, an IOError indicated things like
permissions errors. Now, a custom MutagenError is raised. Now we handle
both.
  • Loading branch information
sampsyo committed Oct 20, 2017
1 parent db71710 commit 14476e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion beetsplug/scrub.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from beets import util
from beets import config
from beets import mediafile
import mutagen

_MUTAGEN_FORMATS = {
'asf': 'ASF',
Expand Down Expand Up @@ -106,7 +107,7 @@ def _scrub(self, path):
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)

Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 14476e2

Please sign in to comment.