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?

What's the cause of this? Do I have to set something special up in
zope.conf just for Page Templates to not convert 'nbsp;' into
'\xa0\xc2'?

-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
fun crosstips.org
_______________________________________________
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to