[python-xmltramp] Patch for RHBZ#750694

Dan Callaghan dcallagh at fedoraproject.org
Fri Jun 7 06:28:35 UTC 2013


commit f4bf3518ecbaf5a3ee84fb404701599ff44ba299
Author: Dan Callaghan <dcallagh at redhat.com>
Date:   Fri Nov 18 15:13:59 2011 +1000

    Patch for RHBZ#750694

 python-xmltramp-2.17-nsprefixes.patch |   20 ++++++++++++++++++++
 python-xmltramp.spec                  |   13 +++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)
---
diff --git a/python-xmltramp-2.17-nsprefixes.patch b/python-xmltramp-2.17-nsprefixes.patch
new file mode 100644
index 0000000..6240f11
--- /dev/null
+++ b/python-xmltramp-2.17-nsprefixes.patch
@@ -0,0 +1,20 @@
+--- a/xmltramp.py	2011-01-07 15:27:58.000000000 +1000
++++ b/xmltramp.py	2011-11-02 14:03:07.881107507 +1000
+@@ -224,7 +224,9 @@
+ 
+ 		attrs = dict(attrs)
+ 		newprefixes = {}
+-		for k in self.prefixes.keys(): newprefixes[k] = self.prefixes[k][-1]
++		for k in self.prefixes.keys():
++			if self.prefixes[k]:
++				newprefixes[k] = self.prefixes[k][-1]
+ 		
+ 		self.stack.append(Element(name, attrs, prefixes=newprefixes.copy()))
+ 	
+@@ -357,5 +359,6 @@
+ 	
+ 	assert parse('<x a="&lt;"></x>').__repr__(1) == '<x a="&lt;"></x>'
+ 	assert parse('<a xmlns="http://a"><b xmlns="http://b"/></a>').__repr__(1) == '<a xmlns="http://a"><b xmlns="http://b"></b></a>'
++	assert parse('<a><b xmlns="http://b"/><c/></a>').__repr__(1) == '<a><b xmlns="http://b"></b><c></c></a>'
+ 	
+ if __name__ == '__main__': unittest()
diff --git a/python-xmltramp.spec b/python-xmltramp.spec
index dae119a..4c343c0 100644
--- a/python-xmltramp.spec
+++ b/python-xmltramp.spec
@@ -2,7 +2,7 @@
 
 Name:           python-xmltramp
 Version:        2.17
-Release:        11%{?dist}
+Release:        12%{?dist}
 Summary:        Pythonic API for XML
 
 Group:          Development/Languages
@@ -12,6 +12,7 @@ License:        GPLv2
 
 URL:            http://www.aaronsw.com/2002/xmltramp/
 Source0:        http://www.aaronsw.com/2002/xmltramp/xmltramp-%{version}.py
+Patch0:         %{name}-%{version}-nsprefixes.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -22,14 +23,19 @@ xmltramp is a simple Pythonic API for working with XML
 
 %prep
 %setup -c -T
+cp -p %{SOURCE0} xmltramp.py
+%patch0 -p1 -b.nsprefixes
 
 %build
 # noarch
 
+%check
+%{__python} xmltramp.py
+
 %install
 rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT/%{python_sitelib}/
-cp -p %{SOURCE0} $RPM_BUILD_ROOT/%{python_sitelib}/xmltramp.py
+cp -p xmltramp.py $RPM_BUILD_ROOT/%{python_sitelib}/
 
  
 %clean
@@ -42,6 +48,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Jun 07 2013 Dan Callaghan <dcallagh at redhat.com> - 2.17-12
+- Patch for RHBZ#750694
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.17-11
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list