X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Futil%2Fxml.py;h=89eef9e00aeb577711c64212ff48c2ca5a36ec43;hb=aaf75e44bd9413d4c7d0ebdb587423e6e43f7f31;hp=78e4c6a23ed7b8a0fa9f6b293182e1104a164f29;hpb=a0f6a0a871ca38cbbb60c384ef8c8adf6afb844a;p=sfa.git diff --git a/sfa/util/xml.py b/sfa/util/xml.py old mode 100755 new mode 100644 index 78e4c6a2..89eef9e0 --- a/sfa/util/xml.py +++ b/sfa/util/xml.py @@ -96,8 +96,15 @@ class XML: elif isinstance(value, int): d[key] = unicode(d[key]) elif value is None: - d.pop(key) - + d.pop(key) + + # element.attrib.update will explode if DateTimes are in the + # dcitionary. + d=d.copy() + for k in d.keys(): + if (type(d[k]) != str) and (type(d[k]) != unicode): + del d[k] + element.attrib.update(d) def validate(self, schema):