diff --git a/docs/changelog.rst b/docs/changelog.rst index eac70a29..a692bb0c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,6 +39,10 @@ Feature release. :meth:`~mopidy.ext.Extension.register_gstreamer_elements`. Use :meth:`mopidy.ext.Extension.setup` instead, as most extensions already do. +**Audio** + +- Fix proper decoding of exception messages that depends on the user's locale. + **HTTP frontend** - CherryPy and ws4py have been replaced with Tornado. This will hopefully @@ -98,6 +102,8 @@ Feature release. a ``local scan`` before running the server the first time resulted in a crash. (Fixes: :issue:`703`) +- Fix proper decoding of exception messages that depends on the user's locale. + v0.18.3 (2014-02-16) ==================== diff --git a/mopidy/audio/scan.py b/mopidy/audio/scan.py index 589ece6d..e872d88c 100644 --- a/mopidy/audio/scan.py +++ b/mopidy/audio/scan.py @@ -10,7 +10,7 @@ import gst # noqa from mopidy import exceptions from mopidy.models import Album, Artist, Track -from mopidy.utils import path +from mopidy.utils import encoding, path class Scanner(object): @@ -90,7 +90,8 @@ class Scanner(object): message = self._bus.pop() if message.type == gst.MESSAGE_ERROR: - raise exceptions.ScannerError(message.parse_error()[0]) + raise exceptions.ScannerError( + encoding.locale_decode(message.parse_error()[0])) elif message.type == gst.MESSAGE_EOS: return tags elif message.type == gst.MESSAGE_ASYNC_DONE: diff --git a/mopidy/local/json.py b/mopidy/local/json.py index c2bde99c..a8997367 100644 --- a/mopidy/local/json.py +++ b/mopidy/local/json.py @@ -13,6 +13,7 @@ import time import mopidy from mopidy import local, models from mopidy.local import search, storage, translator +from mopidy.utils import encoding logger = logging.getLogger(__name__) @@ -22,8 +23,10 @@ def load_library(json_file): try: with gzip.open(json_file, 'rb') as fp: return json.load(fp, object_hook=models.model_json_decoder) - except (IOError, ValueError) as e: - logger.warning('Loading JSON local library failed: %s', e) + except (IOError, ValueError) as error: + logger.warning( + 'Loading JSON local library failed: %s', + encoding.locale_decode(error)) return {}