From a20af9e28a8c9c51c4a2780e73c58f631ec8e4e5 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Fri, 17 Jun 2011 02:00:25 +0200 Subject: [PATCH] appy.pod: bugfix for encoding of XML attributes (see https://bugs.launchpad.net/appy/+bug/779448). --- pod/buffers.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pod/buffers.py b/pod/buffers.py index bce996c..fada406 100644 --- a/pod/buffers.py +++ b/pod/buffers.py @@ -19,6 +19,7 @@ # ------------------------------------------------------------------------------ import re +from xml.sax.saxutils import quoteattr from appy.pod import PodError, XML_SPECIAL_CHARS from appy.pod.elements import * from appy.pod.actions import IfAction, ElseAction, ForAction, VariableAction, \ @@ -141,7 +142,7 @@ class Buffer: def dumpStartElement(self, elem, attrs={}): self.write('<%s' % elem) for name, value in attrs.items(): - self.write(' %s="%s"' % (name, value)) + self.write(' %s=%s' % (name, quoteattr(value))) self.write('>') def dumpEndElement(self, elem): @@ -162,9 +163,6 @@ class Buffer: else: self.write(c) - def dumpAttribute(self, name, value): - self.write(''' %s="%s" ''' % (name, value)) - # ------------------------------------------------------------------------------ class FileBuffer(Buffer): def __init__(self, env, result):