# HG changeset patch # User cmlenz # Date 1160725382 0 # Node ID e09c5b7a64ae0fee50e6c2cc3f998385e6024064 # Parent 1f5753346a75dc3dc7262785b4678cc2dbefb88f Fix bug introduced in [343], that broke the parsing of templates which declare the same namespace more than once in a nested fashion. Thanks to Graham Higgins for reporting the problem. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,14 @@ be configured per instance. +Version 0.3.3 +http://svn.edgewall.org/repos/genshi/tags/0.3.3/ +(?, from branches/stable/0.3.x) + + * Fixed bug introduced in 0.3.2 that broke the parsing of templates which + declare the same namespace more than once in a nested fashion. + + Version 0.3.2 http://svn.edgewall.org/repos/genshi/tags/0.3.2/ (Oct 12 2006, from branches/stable/0.3.x) diff --git a/genshi/template.py b/genshi/template.py --- a/genshi/template.py +++ b/genshi/template.py @@ -1007,8 +1007,8 @@ stream.append((kind, data, pos)) elif kind is END_NS: - uri = ns_prefix.pop(data) - if uri != self.NAMESPACE: + uri = ns_prefix.pop(data, None) + if uri and uri != self.NAMESPACE: stream.append((kind, data, pos)) elif kind is START: diff --git a/genshi/tests/template.py b/genshi/tests/template.py --- a/genshi/tests/template.py +++ b/genshi/tests/template.py @@ -1045,6 +1045,16 @@ self.assertEqual("""
""", str(tmpl.generate())) + def test_parse_with_same_namespace_nested(self): + tmpl = MarkupTemplate("""
+ + +
""") + self.assertEqual("""
+ + +
""", str(tmpl.generate())) + class TextTemplateTestCase(unittest.TestCase): """Tests for text template processing."""