audio, local: Fix decoding of exception messages depending on locale
This commit is contained in:
parent
05803591c5
commit
dcba410d91
@ -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)
|
||||
====================
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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 {}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user