-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Milestone
Description
Whenever you retrieve or create a comment with valid unicode content, the __repr__ method fails on decoding. Seems like it's trying to convert what happens to be a unicode (or ASCII?) string encoded as string, then decoded to UTF. It's only an issue because when I try to print the returned list of Comments from a request, I get the error.
To reproduce:
new_comment = WordPressComment({'content':"\xa0"})
print new_comment
>>> *** UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128)
I think it's the equivalent of doing
print str(u'\xa0')
#or
unicode('\xa0')
But I'm not really familiar with this sort of thing so this could very well be a bad idea, but is it maybe worth trying to use unicode(self) instead of the str(self).encode('utf-8') ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels