From aaf75e44bd9413d4c7d0ebdb587423e6e43f7f31 Mon Sep 17 00:00:00 2001 From: smbaker Date: Sun, 30 Oct 2011 18:54:11 -0700 Subject: [PATCH] fix error with datetime structs in parse_dict --- sfa/util/xml.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) mode change 100755 => 100644 sfa/util/xml.py 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): -- 2.43.0