Hi, On Fri, Dec 4, 2009 at 11:46 PM, mb <[email protected]> wrote:
> My app receives mail and stores them in the datastore. It usually > works fine, but occasionally it has problems decoding the message > body. > > It logs errors like: > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in > position 50: ordinal not in range(128) > > The error happens when trying to decode the message body: > > bodytext = message.bodies(content_type='text/plain').next() > [1].decode() > > Question 1 - do I really need to muck around with detecting different > encodings on each email, or is there an app engine function that makes > it "just work"? > There's nothing that automatically takes care of this for you. The libraries in question are Python libraries, not App Engine ones. > > Question 2 - app engine keeps retrying these failed messages, and they > keep failing. How can I clear them from the queue? > You need to modify your task code to either execute correctly, or not return an error status code when it encounters this. -Nick > > -- > > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > > -- Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
