From 0216ef294a9151e1971f5bb590ca88753dd47dfb Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 4 Feb 2017 13:43:23 -0600 Subject: [PATCH] badfiles: Python 3 compatibility Discovered while working on #2428 that we were using an implicit bytes-to-str conversion on the extension. This broke dict lookup on Python 3. --- beetsplug/badfiles.py | 2 +- docs/changelog.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/beetsplug/badfiles.py b/beetsplug/badfiles.py index 64b75ee3b..368b6eba0 100644 --- a/beetsplug/badfiles.py +++ b/beetsplug/badfiles.py @@ -94,7 +94,7 @@ class BadFiles(BeetsPlugin): ui.colorize('text_error', dpath))) # Run the checker against the file if one is found - ext = os.path.splitext(item.path)[1][1:] + ext = os.path.splitext(item.path)[1][1:].decode('utf8', 'ignore') checker = self.get_checker(ext) if not checker: self._log.debug(u"no checker available for {}", ext) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3ab7940e2..50a2ad518 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -32,6 +32,7 @@ Fixes: * :doc:`/plugins/mpdstats`: Fix Python 3 compatibility. The plugin also now requires version 0.4.2 or later of the ``python-mpd2`` library. :bug:`2405` * :doc:`/plugins/mpdstats`: Improve handling of mpd status queries. +* :doc:`/plugins/badfiles`: Fix Python 3 compatibility. 1.4.3 (January 9, 2017)