Skip to content

Commit 2aa34f8

Browse files
committedAug 15, 2021
Fix bug in __replaceGenerator()
1 parent 35a836c commit 2aa34f8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
 

‎odf/opendocument.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def __replaceGenerator(self):
573573
belonging to the application that created the document.
574574
"""
575575
for m in self.meta.childNodes[:]:
576-
if m.qname == (METANS, u'generator'):
576+
if hasattr(m,'qname') and m.qname == (METANS, u'generator'):
577577
self.meta.removeChild(m)
578578
self.meta.addElement(meta.Generator(text=TOOLSVERSION))
579579

‎tests/examples/parastyles.odt

-56 Bytes
Binary file not shown.

‎tests/testload.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,10 @@ def test_styles_xml(self):
478478
class TestExampleDocs(unittest.TestCase):
479479

480480
def test_metagenerator(self):
481-
""" Check that meta:generator is the original one """
481+
"""
482+
Check that meta:generator is the original one.
483+
Check that spaces in meta.xml is processed correctly.
484+
"""
482485
parastyles_odt = os.path.join(
483486
os.path.dirname(__file__), "examples", "parastyles.odt")
484487
d = load(parastyles_odt)

0 commit comments

Comments
 (0)
Please sign in to comment.