[Bugs] #4157 sugar-toolkit-gtk3 UNSP: Buddy icons not visible in neighbourhood
Sugar Labs Bugs
bugtracker-noreply at sugarlabs.org
Mon Nov 5 17:56:24 EST 2012
#4157: Buddy icons not visible in neighbourhood
------------------------------------------+---------------------------------
Reporter: manuq | Owner: manuq
Type: defect | Status: new
Priority: Unspecified by Maintainer | Milestone: 0.98
Component: sugar-toolkit-gtk3 | Version: Unspecified
Severity: Unspecified | Keywords:
Distribution: Unspecified | Status_field: Unconfirmed
------------------------------------------+---------------------------------
This is because of a string encoding issue. Traceback:
{{{
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py", line
520, in do_get_preferred_height
surface = self._buffer.get_surface()
File "/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py", line
261, in get_surface
handle = self._load_svg(icon_info.file_name)
File "/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py", line
121, in _load_svg
return self._loader.load(file_name, entities, self.cache)
File "/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py", line
66, in load
return Rsvg.Handle.new_from_data(icon)
File "/usr/lib/python2.7/site-packages/gi/types.py", line 76, in
constructor
return info.invoke(cls, *args, **kwargs)
TypeError: Item 0: Must be number or single byte string, not unicode
}}}
In Rsvg.Handle.new_from_data is being called with an unicode but it needs
a str. This is because the other buddies entities come as unicode. Fix:
{{{
--- a/src/sugar3/graphics/icon.py
+++ b/src/sugar3/graphics/icon.py
@@ -57,6 +57,8 @@ class _SVGLoader(object):
for entity, value in entities.items():
if isinstance(value, basestring):
+ if isinstance(value, unicode):
+ entity, value = str(entity), str(value)
xml = '<!ENTITY %s "%s">' % (entity, value)
icon = re.sub('<!ENTITY %s .*>' % entity, xml, icon)
else:
}}}
After fixing this, other issues appear because the other buddiy palette
needs to be fixed too.
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/4157>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list