[firewalld] Make permanenent changes work with Python 2.7.4 (RHBZ#951741)

Jiří Popelka jpopelka at fedoraproject.org
Wed Apr 17 08:11:28 UTC 2013


commit 266373aa73790d7cbac2eadce063996b772a8c35
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Wed Apr 17 10:10:01 2013 +0200

    Make permanenent changes work with Python 2.7.4 (RHBZ#951741)

 firewalld-bz951741.patch |   42 ++++++++++++++++++++++++++++++++++++++++++
 firewalld.spec           |    7 ++++++-
 2 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/firewalld-bz951741.patch b/firewalld-bz951741.patch
new file mode 100644
index 0000000..88a0aa3
--- /dev/null
+++ b/firewalld-bz951741.patch
@@ -0,0 +1,42 @@
+From fb2576f79e3b8cec62116ee27052c1c92906f6da Mon Sep 17 00:00:00 2001
+From: Jiri Popelka <jpopelka at 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
+
diff --git a/firewalld.spec b/firewalld.spec
index 237ba1a..7980019 100644
--- a/firewalld.spec
+++ b/firewalld.spec
@@ -1,7 +1,7 @@
 Summary: A firewall daemon with D-BUS interface providing a dynamic firewall
 Name: firewalld
 Version: 0.3.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 URL: http://fedorahosted.org/firewalld
 License: GPLv2+
 ExclusiveOS: Linux
@@ -10,6 +10,7 @@ BuildArch: noarch
 Source0: https://fedorahosted.org/released/firewalld/%{name}-%{version}.tar.bz2
 %if 0%{?fedora} > 17
 Patch0: firewalld-0.2.6-MDNS-default.patch
+Patch1: firewalld-bz951741.patch
 %endif
 BuildRequires: desktop-file-utils
 BuildRequires: gettext
@@ -74,6 +75,7 @@ firewalld.
 %setup -q
 %if 0%{?fedora} > 17
 %patch0 -p1
+%patch1 -p1
 %endif
 
 %build
@@ -194,6 +196,9 @@ fi
 %{_datadir}/icons/hicolor/*/apps/firewall-config*.*
 
 %changelog
+* Wed Apr 17 2013 Jiri Popelka <jpopelka at redhat.com> - 0.3.1-2
+- Make permanenent changes work with Python 2.7.4 (RHBZ#951741)
+
 * Thu Mar 28 2013 Thomas Woerner <twoerner at redhat.com> 0.3.1-1
 - Use explicit file lists for make dist
 - New rich rule validation check code


More information about the scm-commits mailing list