diff options
Diffstat (limited to 'libbe/comment.py')
-rw-r--r-- | libbe/comment.py | 5 |
1 files changed, 4 insertions, 1 deletions
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. |