[Grok-dev] thoughts while writing a tutorial

Andreas Jung lists at zopyx.com
Wed Aug 22 10:50:14 EDT 2007



--On 22. August 2007 10:38:41 -0400 Brandon Craig Rhodes 
<brandon at rhodesmill.org> wrote:

> Darryl, thank you for the guidance on getting "grok2html" to find and
> process my tutorial!  I can now see what tutorial looks like rendered.
>
> I am about halfway done, but have run into a problem: adding a Unicode
> character to my tutorial results in an exception, and I cannot quite
> determine what's wrong.  It looks like the file gets read as Unicode,
> and begins to be processed as Unicode; but somewhere, once it reaches
> the Zope template library, something tries applying 'ascii' to it:
>
> Traceback (most recent call last):
>   File "/home/brandon/projects/grok/grok/bin/grok2html", line 75, in
> <module>     grok2html.main()
>   File "/home/brandon/projects/grok/grok/doc/grok2html.py", line 188, in
> main     create_html(rest_files, template)
>   File "/home/brandon/projects/grok/grok/doc/grok2html.py", line 132, in
> create_html     restfile.create_html(page, settings)
>   File "/home/brandon/projects/grok/grok/doc/grok2html.py", line 92, in
> create_html     content = page.pt_render(namespace=settings)
>   File
> "/home/brandon/projects/grok/grok/eggs/tmp68sMaw/zope.pagetemplate-3.4.0a
> 1-py2.5.egg/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
> File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 271, in __call__   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 346, in interpret   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 891, in do_useMacro   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 346, in interpret   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 536, in do_optTag_tal   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 521, in do_optTag   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 516, in no_tag   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 346, in interpret   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 534, in do_optTag_tal   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 516, in no_tag   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 346, in interpret   File
> "/home/brandon/projects/grok/grok/eggs/tmpjGfPni/zope.tal-3.4.0b1-py2.5.e
> gg/zope/tal/talinterpreter.py", line 754, in do_insertStructure_tal
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> 2258: ordinal not in range(128)
>
>

I fixed a similar issue with 'structure' some days ago for Zope 2:

<http://svn.zope.org/Zope/trunk/lib/python/Products/PageTemplates/Expressions.py?rev=78767&r1=71802&r2=78767>

Not sure if both issues are related and if they should be addressed
on the Zope 3 level directly instead within the Zope 2 wrapper.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20070822/20d746d7/attachment-0001.bin


More information about the Grok-dev mailing list