[Zope-dev] UnicodeDecodeError from PageTemplate rendering after upgrading to Zope 2.12.7

Vladislav Vorobiev mymir.org at googlemail.com
Tue Aug 31 07:30:18 EDT 2010


Maybe not the best solution but I use this hack:

zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py

line 751
change:

            text = unicode(structure)

to

            try:
                 text = unicode(structure)
            except:
                 text=unicode(structure.decode('utf-8'))

Vlad


2010/8/31 Chris Withers <chris at simplistix.co.uk>:
> Hi All,
>
> After a recent upgraded to Zope 2.12, I'm now seeing errors like the
> following when using IE (version 8) or Safari (version 4.0.3) to view
> page templates. Chrome and Firefox work fine.
>
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 127, in publish
>   Module ZPublisher.mapply, line 77, in mapply
>   Module ZPublisher.Publish, line 47, in call_object
> <snip>
>   Module Shared.DC.Scripts.Bindings, line 324, in __call__
>   Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
>   Module Products.PageTemplates.ZopePageTemplate, line 335, in _exec
>   Module Products.PageTemplates.ZopePageTemplate, line 432, in pt_render
>   Module Products.PageTemplates.PageTemplate, line 80, in pt_render
>   Module zope.pagetemplate.pagetemplate, line 115, in pt_render
>   Module zope.tal.talinterpreter, line 271, in __call__
> <snip>
>   Module zope.tal.talinterpreter, line 343, in interpret
>   Module zope.tal.talinterpreter, line 751, in do_insertStructure_tal
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position
> 366: ordinal not in range(128)
>
> Has anyone seen this or anything similar before?
> Any solutions spring to mind?
>
> cheers,
>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
>             - http://www.simplistix.co.uk
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
>



-- 
Best Regards
Vlad Vorobiev


More information about the Zope-Dev mailing list