After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 601171 - Context pane crashes with lyrics containing invalid unicode
Context pane crashes with lyrics containing invalid unicode
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: Plugins (other)
HEAD
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-08 16:57 UTC by Mika Wahlroos
Modified: 2018-05-24 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mika Wahlroos 2009-11-08 16:57:09 UTC
The context pane plugin crashes Rhythmbox when attempting to display lyrics that contain invalid unicode characters.

Traceback (most recent call last):
  • File "/usr/local/lib/rhythmbox/plugins/context/LyricsTab.py", line 128 in lyrics_ready
    stylesheet = self.styles)
  • File "/usr/lib/python2.6/dist-packages/mako/template.py", line 133 in render
    return runtime._render(self, self.callable_, args, data)
  • File "/usr/lib/python2.6/dist-packages/mako/runtime.py", line 347 in _render
    _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))
  • File "/usr/lib/python2.6/dist-packages/mako/runtime.py", line 364 in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  • File "/usr/lib/python2.6/dist-packages/mako/runtime.py", line 397 in _exec_template
    callable_(context, *args, **kwargs)
  • File "/tmp/context/usr/local/lib/rhythmbox/plugins/context/tmpl/lyrics-tmpl.html.py", line 41 in render_body
    __M_writer(unicode(lyrics))
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 427: unexpected code byte

The code tries to turn the lyrics into a unicode object with unicode error checking enabled (which is the default behaviour for the function) but doesn't check for potential errors raised by the call.

The actual call is made by code generated from the template by the template system. I'm not very familiar with Mako templates but I guess the code would either need to convert the string to proper unicode before using it in the template, or somehow tell the template system not to use strict error checking.
Comment 1 Mika Wahlroos 2009-11-23 02:48:54 UTC
Looks like the cases I have at hand are all ones with 0x92 where there should be an apostrophe. All of these lyrics I've seen now that I started looking into it seem to be from lyrics.astraweb.com but not all lyrics from Astraweb suffer from it. The lyrics tab in the track properties window also fails to show these lyrics. Interestingly the characters appear correctly on the Astraweb site even though the character being transmitted is the same 0x92.
Comment 2 Jonathan Matthew 2009-11-29 04:46:42 UTC
Looks like astraweb is claiming its responses are iso-8859-1 encoded but they're actually in windows-1250. 0x92 in that encoding is U+2019 (right single quotation mark), which gucharmap says is the preferred character to use for apostrophes. It probably gets displayed correctly on the site because web browsers are used to dealing with this sort of crap.
Comment 3 Jonathan Matthew 2010-02-21 21:03:44 UTC
I've fixed the crash, which was not actually a crash, it was dbus exiting after being disconnected because we sent invalid utf8 strings.  The lyrics plugin needs to do better charset conversion, and the context pane plugin probably needs to handle exceptions from the template code a bit better.
Comment 4 GNOME Infrastructure Team 2018-05-24 14:51:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/838.