On Sat, Sep 6, 2008 at 5:13 AM, bubblboy <[EMAIL PROTECTED]> wrote: > > Somebody in #web.py reported this problem: > <http://pastebin.com/d4e2e493>. It causes a UnicodeEncodeError on line > 238 in utils.py (safestr, the subject of changes since r277, reported as > the first version that breaks that code), bazaar revision 278 [1]. > Apparently, calling .get('__body__', '') on a TemplateResult instance > (teplate.py [2] line 1007) does not return a string, because calling > safestr() on the object that call returns goes into line 238, which > means it's neither an instance of unicode nor of str. The object it > returns, then, should at least have a .__str__ method that automatically > encodes to utf-8 (since that seems to be the implicit encoding > everywhere). Now it's just trying to encode to python built-in encoding > (ASCII), which is a problem.
I am not sure if I understand the problem clearly. Output of template call is a always a TemplateResult object. It has both __str__ and __unicode__ methods defined. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" 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/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
