[Zope] Zope 2.12 and ZPT

Andreas Jung lists at zopyx.com
Sat May 1 09:40:50 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Bengtsson wrote:
> I'm trying to get a product running in Zope 2.12 which I installed in
> a virtualenv with easy_install. It starts fine and all but when I try
> to render a piece of ZPT I get this weird error:
> 
> 
> 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
>   Module Products.IssueTrackerProduct.IssueTracker, line 12629, in AddIssue
>   Module Shared.DC.Scripts.Bindings, line 324, in __call__
>   Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
>   Module Products.PageTemplates.PageTemplateFile, line 130, in _exec
>   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__
>   Module zope.tal.talinterpreter, line 343, in interpret
>   Module zope.tal.talinterpreter, line 888, in do_useMacro
>   Module zope.tal.talinterpreter, line 343, in interpret
>   Module zope.tal.talinterpreter, line 533, in do_optTag_tal
>   Module zope.tal.talinterpreter, line 518, in do_optTag
>   Module zope.tal.talinterpreter, line 513, in no_tag
>   Module zope.tal.talinterpreter, line 343, in interpret
>   Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
>   Module Products.PageTemplates.Expressions, line 220, in evaluateStructure
>   Module zope.tales.tales, line 696, in evaluate
>   Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
>    - __traceback_info__: here.getRoot().title_or_id().replace(' ',' ')
>   Module PythonExpr, line 1, in <expression>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position
> 0: ordinal not in range(128)
> 
> 
> After a lot of trial-and-error I managed to figure out that the
> culprit was this piece of ZPT code:
> tal:content="structure python:here.getRoot().title_or_id().replace('
> ','&nbsp;')"
> Stupid and easy to fix; maybe but what if there are other problems like this?
> 
> 
Likely related to the new ZPT engine since Zope 2.10.

Either you deal with this using the unicode conflict resolver of ZPT
or ensure that you don't mix up different encodings since ZPT now uses
unicode internally.

- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvcL2IACgkQCJIWIbr9KYzjqACfWQ+7gQO0wO2q3vFzptxvrs5Q
7CoAnRiCa6aTeOqX58GBN9DHubwKkYr1
=myaM
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20100501/17c1e2f0/attachment.vcf 


More information about the Zope mailing list