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
This commit is contained in:
Walter Bender 2013-09-08 15:25:38 -04:00 committed by Daniel Narvaez
parent e01837f8be
commit ec5f064c10

View File

@ -62,7 +62,7 @@ class _SVGLoader(object):
logging.error( logging.error(
'Icon %s, entity %s is invalid.', file_name, entity) '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): class _IconInfo(object):