From ec5f064c10d902958eb49035b2c35f91a7055267 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 8 Sep 2013 15:25:38 -0400 Subject: [PATCH] Ensure entity value is type str There are times when the entity value passed in for substitution is of type unicode. This causes Rsvg to fail when processing the SVG. This patch checks for unicode and converts it to utf-8. Fixes #4621 --- src/sugar3/graphics/icon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py index e7bca562..ed499d2c 100644 --- a/src/sugar3/graphics/icon.py +++ b/src/sugar3/graphics/icon.py @@ -62,7 +62,7 @@ class _SVGLoader(object): logging.error( 'Icon %s, entity %s is invalid.', file_name, entity) - return Rsvg.Handle.new_from_data(icon) + return Rsvg.Handle.new_from_data(icon.encode('utf-8')) class _IconInfo(object):