[Bugs] #4621 Sugar UNSP: icon entities cannot be unicode or Rsvg chokes

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Fri Sep 6 15:02:56 EDT 2013


#4621: icon entities cannot be unicode or Rsvg chokes
---------------------------------------------+-----------------------------
       Reporter:  walter                     |       Owner:
           Type:  defect                     |      Status:  new
       Priority:  Unspecified by Maintainer  |   Milestone:  Unspecified
      Component:  Sugar                      |     Version:  Git as of
       Severity:  Unspecified                |  bugdate
Distribution/OS:  Fedora                     |    Keywords:  AU1B
                                             |  Bug Status:  Unconfirmed
---------------------------------------------+-----------------------------
\
\
 _SVGLoader in icon.py processes entities in order to map Sugar icons into
 user colors. It then calls Rsvg to generate the icon SVG. All is well if
 the icon colors are type str, but if they are type unicode, Rsvg generates
 an error.

 In the Comments class in Sugar Journal expandedentry.py icon colors are
 extracted from metadata using json.loads. This call (at least on F19)
 converts all strings to type unicode. Hence the comment icons are not
 rendering since they trigger the problem described above.

 A simple fix is to convert the icon colors to str with encode('ascii',
 'replace') after the call from json.loads. A more robust fix might be to
 test for unicode in icon.py.

 I've prepared both patches. Which would be best?
\
\
\

--
Ticket URL: <http://bugs.sugarlabs.org/ticket/4621>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list