-
Notifications
You must be signed in to change notification settings - Fork 25
Description
[Migrated from bitbucket https://bitbucket.org/richardjones/python-sword2/issue/2/class-entry-doesnt-work-when-etree]
Entry.str fails when trying to serialise the namespace map (self.nsmap):
File "sword2/atom_objects.py", line 250, in str xml_str = etree.tostring(self.entry) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1121, in tostring ElementTree(element).write(file, encoding, method=method) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 815, in write serialize(write, self._root, encoding, qnames, namespaces) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 934, in _serialize_xml _serialize_xml(write, e, encoding, qnames, None) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 927, in _serialize_xml v = _escape_attrib(v, encoding) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1087, in _escape_attrib _raise_serialization_error(text) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1047, in _raise_serialization_error "cannot serialize %r (type %s)" % (text, type(text).name) TypeError: cannot serialize {'dcterms': 'http://purl.org/dc/terms/', 'atom': 'http://www.w3.org/2005/Atom'} (type dict)