Skip to content Skip to sidebar Skip to footer

Gae Python Ascii Codec Cant Decode Byte

When I run my application, which finds links, checks if they exist in the database, and adds them to the database, I get an error. Traceback (most recent call last): File '/base/

Solution 1:

As the last line of the stack trace shows, it's trying to convert the value to unicode first and then encoding it as utf-8. However, the (implicit) conversion is using ascii, which is not enough for your string. You could try converting it to unicode yourself, using the right encoding, before passing it to filter. Example:

u = Articles.all().filter("name =", name.decode('utf-8')).get()

(remember that you need to provide the correct encoding; if name is not a UTF-8 string, but a Cp1252, ISO-Latin or something else, you need to specify that in the decode call)

Post a Comment for "Gae Python Ascii Codec Cant Decode Byte"