Umlaut in spotify username

Hey there,

i’ve got an “ü” in my spotify username but spotify did not work on the musicbox, so i changed file encoding of settings.ini to UTF-8. Booting and Playing music just works fine. But opening the Settings tab on musicbox.local gives me an error: “UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 8: ordinal not in range(128)”. Trying to make the setting from Settings tab did not work, seemed like it was doing nothing…

Any ideas to fix it?

thanks in advance,
Timo

If you can provide the full stacktrace ending with the “UnicodeDecodeError”, we can probably track down where the problem is and fix it :slight_smile:

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mopidy/http/actor.py", line 197, in Settings
    return template.render ( templateVars )
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/webclient/settings/index.html", line 186, in top-level template code
    <input type="password" name="spotify__password" value="{{ spotify__password }}" size="10" maxlength="40"/>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)

This looks like a bug in the Musicbox webclient’s settings page that has already been reported in https://github.com/woutervanwijk/Mopidy-MusicBox-Webclient/issues/27.

Oh okay.

So there’s no fix yet?

thanks

There is no fix released yet but you should be able to get it working yourself using https://github.com/woutervanwijk/Pi-MusicBox/issues/131#issuecomment-51715189

1 Like

I’ll include it in 0.5.1

1 Like

adding the encoding='utf8' parameter to the four uses of ConfigObj(...) in /opt/musicbox/http/actor.py fixed the problem for me.

Thank you very much =)

Great, I will add it.

I noticed a problem with umlaut in artist names, also (no result when searching). I think it can be solved the same way but in another file maybe. I’ll test tomorrow!

edit: in mopidy.log is the following error:

    2014-09-15 08:19:55,976 - WARNING  /usr/lib/python2.7/urllib.py:1268: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  return ''.join(map(quoter, s))

editing the python lib is not a good idea. Any suggestions which file needs to be edited?

I am trying to build an extension out of my previous work for the MusicBox settings page: It does not work yet, but I want to support unicode: https://github.com/woutervanwijk/mopidy-websettings

1 Like