Note that for some reason in the *test suite*, I can't reproduce the
behavior either.
But I can reproduce it via the script at http://cluegun.repoze.org/26
when I run it interactively.
[chrism@oops z3c.pt]$ bin/py failstatic.py
Traceback (most recent call last):
File "bin/py", line 48, in <module>
execfile(sys.argv[0])
File "failstatic.py", line 21, in <module>
print t.render(foo=u'foo')
File "/Users/chrism/projects/z3c.pt/src/z3c/pt/template.py", line
78, in render
return template(**kwargs)
File "<string>", line 26, in render
File "/Users/chrism/projects/z3c.pt/src/z3c/pt/generation.py",
line 112, in getvalue
return ''.join(self)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position
46: ordinal not in range(128)
On Aug 11, 2008, at 1:08 PM, Malthe Borch wrote:
> Log message for revision 89674:
> (Failed) Attempt at reproducing unicode-issue. The correct output
> is produced.
> Changed:
> U z3c.pt/trunk/src/z3c/pt/translation.txt
> -=-
> Modified: z3c.pt/trunk/src/z3c/pt/translation.txt
> ===================================================================
> --- z3c.pt/trunk/src/z3c/pt/translation.txt 2008-08-11 17:00:37 UTC
> (rev 89673)
> +++ z3c.pt/trunk/src/z3c/pt/translation.txt 2008-08-11 17:08:18 UTC
> (rev 89674)
> @@ -515,17 +515,26 @@
> py:with
> + >>> def quote():
> + ... return dict(author=u"Some name", quote=u"Some random
> quote")
> +
>>>> print render("""\
> ... <div xmlns="http://www.w3.org/1999/xhtml"
> ... xmlns:py="http://genshi.edgewall.org">
> ... <span py:with="x=2; y=7; z=x+10">${x} ${y} ${z}</span>
> ... <py:with vars="x=4; y=3; z=x+5">${x} ${y} ${z}</py:with>
> - ... </div>""", translate_xml)
> + ... <blockquote py:with="q=quote()">
> + ... "${q["quote"]} <em>${q["author"]}</em>
> + ... </blockquote>
> + ... </div>""", translate_xml, quote=quote)
> <div>
> <span>2 7 12</span>
> 4 3 9
> + <blockquote>
> + "Some random quote <em>Some name</em>
> + </blockquote>
> </div>
> -
> +
> py:attrs
>>>> print render("""\
> _______________________________________________
> Checkins mailing list
> Check...@zope.org
> http://mail.zope.org/mailman/listinfo/checkins