From bb482abafe4bc6d88cbbc4abc36967a3012e9f50 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Thu, 25 Apr 2013 00:22:59 +0200 Subject: giscanner: remove unneeded encode('utf-8').decode('utf-8') roundtrip line is a unicode() instance, xml.sax.saxutils.escape() does nothing more than call a couple of replace() methods on said unicode() instance so it makes little sense to encode line into a str() and decode the escaped result back into a unicode(). https://bugzilla.gnome.org/show_bug.cgi?id=699533 --- giscanner/xmlwriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py index 11f84859..4a1dc9fb 100755 --- a/giscanner/xmlwriter.py +++ b/giscanner/xmlwriter.py @@ -135,7 +135,7 @@ class XMLWriter(object): line = line.decode('utf-8') assert isinstance(line, unicode) if do_escape: - line = escape(line.encode('utf-8')).decode('utf-8') + line = escape(line) if indent: self._data.write('%s%s%s' % ( self._indent_char * self._indent, -- cgit v1.2.1