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

This commit is contained in:
Jiri Popelka 2013-04-17 10:10:01 +02:00
parent c802b43c04
commit 266373aa73
2 changed files with 48 additions and 1 deletions

42
firewalld-bz951741.patch Normal file
View File

@ -0,0 +1,42 @@
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

View File

@ -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@redhat.com> - 0.3.1-2
- Make permanenent changes work with Python 2.7.4 (RHBZ#951741)
* Thu Mar 28 2013 Thomas Woerner <twoerner@redhat.com> 0.3.1-1
- Use explicit file lists for make dist
- New rich rule validation check code