firewalld/firewalld-bz951741.patch

43 lines
1.5 KiB
Diff

From fb2576f79e3b8cec62116ee27052c1c92906f6da Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Wed, 17 Apr 2013 09:58:42 +0200
Subject: [PATCH] IO_Object_XMLGenerator: make it work with Python 2.7.4
(RHBZ#951741)
Since Python 2.7.4 saxutils.XMLGenerator has been using
io.TextIOBase.write() which takes unicode string.
This should be transparent for us, the problem is that in
IO_Object_XMLGenerator.simpleElement() we've been
calling directly saxutils.XMLGenerator._write() which now
takes unicode instead of str.
IO_Object_XMLGenerator.simpleElement() is almost a copy of
saxutils.XMLGenerator.startElement() so we can change it the
same way.
---
src/firewall/core/io/io_object.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/firewall/core/io/io_object.py b/src/firewall/core/io/io_object.py
index 0931190..934db98 100644
--- a/src/firewall/core/io/io_object.py
+++ b/src/firewall/core/io/io_object.py
@@ -187,10 +187,10 @@ class IO_Object_XMLGenerator(saxutils.XMLGenerator):
saxutils.XMLGenerator.__init__(self, out, "utf-8")
def simpleElement(self, name, attrs):
- self._write('<' + name)
+ self._write(u'<' + name)
for (name, value) in attrs.items():
- self._write(' %s=%s' % (name, saxutils.quoteattr(value)))
- self._write('/>')
+ self._write(u' %s=%s' % (name, saxutils.quoteattr(value)))
+ self._write(u'/>')
def check_port(port):
port_range = functions.getPortRange(port)
--
1.8.2