diff --git a/mopidy/models.py b/mopidy/models.py index b1f0b351..e14fd8b4 100644 --- a/mopidy/models.py +++ b/mopidy/models.py @@ -127,11 +127,16 @@ def model_json_decoder(dct): {u'a_track': Track(artists=[], name=u'name')} """ + # NOTE kwargs dict keys must be bytestrings to work on Python < 2.6.5 + # See https://github.com/mopidy/mopidy/issues/302 for details. if '__model__' in dct: model_name = dct.pop('__model__') cls = globals().get(model_name, None) if issubclass(cls, ImmutableObject): - return cls(**dct) + kwargs = {} + for key, value in dct.items(): + kwargs[str(key)] = value + return cls(**kwargs) return dct