From ce91a0c929e99982696af6d91bc2bccd9d821ca3 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 9 Jun 2015 16:34:02 -0700 Subject: [PATCH] keyfinder: Fix #1502 (unicode paths) --- beetsplug/keyfinder.py | 11 +++++++++-- docs/changelog.rst | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/beetsplug/keyfinder.py b/beetsplug/keyfinder.py index fa86b1c69..e3e9a86ba 100644 --- a/beetsplug/keyfinder.py +++ b/beetsplug/keyfinder.py @@ -61,9 +61,16 @@ class KeyFinderPlugin(BeetsPlugin): continue try: - output = util.command_output([bin, '-f', item.path]) + output = util.command_output([bin, b'-f', + util.syspath(item.path)]) except (subprocess.CalledProcessError, OSError) as exc: - self._log.error(u'execution failed: {0}', exc) + self._log.error('execution failed: {0}', exc) + continue + except UnicodeEncodeError: + # Workaround for Python 2 Windows bug. + # http://bugs.python.org/issue1759845 + self._log.error('execution failed for Unicode path: {0!r}', + item.path) continue key_raw = output.rsplit(None, 1)[-1] diff --git a/docs/changelog.rst b/docs/changelog.rst index ed567dc8a..e23217196 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -59,6 +59,7 @@ Fixes: * Fix a bug, where the autotagger still considers matches that are specifically listed under the config's ignored section. :bug:`1487` * Fix a bug with unicode strings when generating thumbnails. :bug:`1485` +* :doc:`/plugins/keyfinder`: Fix handling of Unicode paths. :bug:`1502` 1.3.13 (April 24, 2015)