From 313c3807aaf011fa2ccfe2d04d9c12126a1e51c3 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 2 Feb 2015 10:42:31 -0800 Subject: [PATCH] scrub: Use `syspath` in `beet scrub` (#1297) --- beetsplug/scrub.py | 7 ++++--- docs/changelog.rst | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/beetsplug/scrub.py b/beetsplug/scrub.py index 066387f74..f6a3bed27 100644 --- a/beetsplug/scrub.py +++ b/beetsplug/scrub.py @@ -71,10 +71,11 @@ class ScrubPlugin(BeetsPlugin): # Get album art if we need to restore it. if opts.write: try: - mf = mediafile.MediaFile(item.path, + mf = mediafile.MediaFile(util.syspath(item.path), config['id3v23'].get(bool)) except IOError as exc: - self._log.error(u'scrubbing failed: {0}', exc) + self._log.error(u'could not open file to scrub: {0}', + exc) art = mf.art # Remove all tags. @@ -86,7 +87,7 @@ class ScrubPlugin(BeetsPlugin): item.try_write() if art: self._log.info(u'restoring art') - mf = mediafile.MediaFile(item.path) + mf = mediafile.MediaFile(util.syspath(item.path)) mf.art = art mf.save() diff --git a/docs/changelog.rst b/docs/changelog.rst index 77ef019ab..ba5934c4c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -94,7 +94,8 @@ Fixes: * :doc:`/plugins/embedart`: Fix a crash that occured when used together with the *check* plugin. :bug:`1241` * :doc:`/plugins/scrub`: Log an error instead of stopping when the ``beet - scrub`` command cannot write a file. :bug:`1297` + scrub`` command cannot write a file. Also, avoid problems on Windows with + Unicode filenames. :bug:`1297` For developers: