New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError in audio/actor.py:203 #347

Closed
jodal opened this Issue Mar 20, 2013 · 1 comment

Comments

1 participant
@jodal
Member

jodal commented Mar 20, 2013

Reported by @LucsT on IRC:

Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 850, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 203: ordinal not in range(128)
Logged from file actor.py, line 203

Adding assert False, (error, debug) above the line mopidy/audio/actor.py:203 yields:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/mopidy/audio/actor.py", line 203, in _on_message
    assert False, (error, debug)
AssertionError: (<GError at 0x1fa1f80>, 'gstfilesrc.c(1042): gst_file_src_start (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstFileSrc:source:\nNo such file "/media/Data/Musique/Le donjon de Naheulbeuk/Machins de Tavernes/01. Intro \xc3\x83\xc2\xa0 la taverne.mp3"')
Traceback (most recent call last):
WARNING  Setting GStreamer state to GST_STATE_PLAYING failed
  File "/usr/lib/pymodules/python2.7/mopidy/audio/actor.py", line 203, in _on_message
    assert False, (error, debug)
AssertionError: (<GError at 0x1ebb9c0>, 'gstfilesrc.c(1042): gst_file_src_start (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstFileSrc:source:\nNo such file "/media/Data/Musique/Le donjon de Naheulbeuk/Machins de Tavernes/01. Intro \xc3\x83\xc2\xa0 la taverne.mp3"')

The error message contains UTF-8 encoded file paths which can't be converted to Unicode without explicitly decoding the debug bytestring as UTF-8. The big question is if these strings are always UTF-8, or if they will contain other encodings depending on the encoding used for file names on the file system.

@jodal

This comment has been minimized.

Member

jodal commented Mar 30, 2013

According to the gst_get_error_message() docs at https://developer.gnome.org/gstreamer/stable/gstreamer-GstGError.html the message is defined to always have UTF-8 encoding.

@jodal jodal closed this in 9e5f070 Mar 30, 2013

@ghost ghost assigned jodal Mar 30, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment