diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spam@spamtrap.com> | 2012-03-03 10:59:43 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2012-03-03 10:59:43 -0500 |
commit | 187bface721aec16800e612cc292c1fec4ee966b (patch) | |
tree | fff89497d65afb9757562a1b06e34d020ac65919 /libbe | |
parent | a583b395494c86460fbddbd81a2eb37afe05135c (diff) | |
download | bugseverywhere-187bface721aec16800e612cc292c1fec4ee966b.tar.gz |
Fix `be import_xml` bugs.
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/bug.py | 5 | ||||
-rw-r--r-- | libbe/comment.py | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libbe/bug.py b/libbe/bug.py index 3b9be59..f562836 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -410,8 +410,9 @@ class Bug (settings_object.SavedSettingsObject): uuid = text continue # don't set the bug's uuid tag. elif child.tag == 'created': - self.time = utility.str_to_time(text) - self.explicit_attrs.append('time') + if text is not settings_object.EMPTY: + self.time = utility.str_to_time(text) + self.explicit_attrs.append('time') continue elif child.tag == 'extra-string': estrs.append(text) diff --git a/libbe/comment.py b/libbe/comment.py index 082a46f..cfb951d 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -377,7 +377,10 @@ class Comment (Tree, settings_object.SavedSettingsObject): text = settings_object.EMPTY else: text = xml.sax.saxutils.unescape(child.text) - text = text.decode('unicode_escape').strip() + # Sometimes saxutils returns unicode + if not isinstance(text, unicode): + text = text.decode('unicode_escape') + text = text.strip() if child.tag == 'uuid' and not preserve_uuids: uuid = text continue # don't set the comment's uuid tag. |