MPD Error after successful Connect

Hello,

after Connecting a MPD Client to mopidy i get after a short time following error:

2015-02-04 06:30:11,901 ERROR [3714:MpdSession-27] pykka: Unhandled exception in MpdSession (urn:uuid:9595028c-486c-4c89-813a-785c3cafc057):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/session.py", line 41, in on_line_received
    self.send_lines(response)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 428, in send_lines
    self.connection.queue_send(self.encode(data))
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 189, in queue_send
    self.send_buffer = self.send(self.send_buffer + data)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 202, in send
    self.stop('Unexpected client error: %s' % e)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128)

I turned on debugging:

file: local:track:Datarock/Kein%20Titel/11%20AudioTrack%2011.mp3
    Time: 236
    Artist: Datarock
    Title: AudioTrack 11
    Album: Kein Titel
    Track: 11
    Genre: Unbekannt
    OK
ERROR    2015-02-04 06:30:11,901 [3714:MpdSession-27] pykka
  Unhandled exception in MpdSession (urn:uuid:9595028c-486c-4c89-813a-785c3cafc057):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/session.py", line 41, in on_line_received
    self.send_lines(response)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 428, in send_lines
    self.connection.queue_send(self.encode(data))
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 189, in queue_send
    self.send_buffer = self.send(self.send_buffer + data)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 202, in send
    self.stop('Unexpected client error: %s' % e)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128)
DEBUG    2015-02-04 06:30:12,098 [3714:MpdSession-27] pykka
  Unregistered MpdSession (urn:uuid:9595028c-486c-4c89-813a-785c3cafc057)

My thought is that in some auf my Tracks are non UTF8 chars.

Is this an bug in mopidy or have I to take care of the Encoding.

Edited: Added formatting. @jodal

This looks like a bug where Mopidy does not handle UTF-8 in an exception message properly. The byte 0xc3 is probably the first byte of a two-byte UTF-8-encoded character. Please open an issue.

If you wan’t to help figure out what the string that failed decoding is, you can change %s to %r in /usr/lib/python2.7/dist-packages/mopidy/utils/network.py line 202, and then reproduce the error.