clementine-scope crashed with UnicodeEncodeError in update_results_model(): 'ascii' codec can't encode character u'\xa0' in position 4: ordinal not in range(128)

Bug #996663 reported by DemocritusJr
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Unity Music Lens
New
Undecided
Unassigned

Bug Description

Ubuntu 12.04 (I386)
clementine-scope Installed: 0.4-0~14~precise1
After install, upon searching for music in the dash, error is reported. Apport was unable to complete the report for unknown reasons.
I expected dash to open my chosen music selection in Clementine.

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/996663/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → unity-music-lens
Revision history for this message
Iván Campaña (ivan-campana) wrote :

Seems like it is having trouble handling some of the fields from each track, probably because of accents or special characters, I had the same error because I use spanish as my main language and some tracks of my collection have accents, I narrowed the problem to line # 209 in the file /usr/lib/unity-lens-music/clementine-scope

This is where it reads all the tracks info and prepares it for the lens to work with, what I saw is that it doesn't have an exception handler (and a fallback in case of problems), so I added one temporarily to avoid having that nasty error report, currently it won't solve the real problem as is (I will work on it to fix it), but at least now it won't crash and won't report errors when reading the library allowing us to use it, the only downside is that probably some songs won't appear (the ones with special characters and accents not being propperly handled).

Here is what I changed:

  for track in self.tracks:
   try:
    title = u"" if track[0] is None else unicode(track[0])
    uri = u"" if track[1] is None else unicode(track[1])
    artist = u"" if track[2] is None else unicode(track[2])
    album = u"" if track[3] is None else unicode(track[3])
    mimetype = u"" if track[4] is None else unicode(track[4])
    albumartist = u"" if track[5] is None else unicode(track[5])
    itemtype = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio"
    trackname = title + " - " + album + " - " + artist
   except Exception as e:
    print "Unicode Error({0}): {1}".format(e.errno, e.strerror)
   except:
    print "Unexpected error:", sys.exc_info()[0]

I include the modified file just in case someone wants to copy it.

Revision history for this message
DemocritusJr (disponibel) wrote :

That fixes the reported error. I haven't reviewed my files for special characters, but it's possible one slipped by. Thanks for working on this!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.