On 9/25/05, Bryan Murdock <[EMAIL PROTECTED]> wrote:
> Also, I still get this error now that I've decoded cp1252 and encoded utf-8:
>
> Traceback (most recent call last):
>   File "./lesson_todo", line 159, in ?
>     lessonTodo = bp.list.create( lessonsPage[0], todo )
>   File "backpack.py", line 462, in create
>     return self._parseList(x)[0]
>   File "backpack.py", line 444, in _parseList
>     rv.append((int(item.getAttribute("id")),
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in
> position 4: ordinal not in range(128)
>
> Was encoding to utf-8 a bad idea?

Looking close at this error, the whole rv.append call looks like this:

rv.append((int(item.getAttribute("id")),
                item.getAttribute("completed") == "true",
                str(item.firstChild.data)))

data at this point includes the utf-8 quotation marks, so I'm guessing
the real problem is the str call, right?  I'm getting tired, but is
there a quickie way to fix this I'm not seeing?  I'm not opposed to
modifying the libray to better handle this unicode stuff.

Thanks again!

Bryan
_______________________________________________
Ldsoss mailing list
[email protected]
http://lists.ldsoss.org/mailman/listinfo/ldsoss

Reply via email to