Hi,
On Apr 15, 12:30 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> > If you're including non-ascii text inside of a Mako template, make
> > sure you specify a magic encoding comment at the top of the file:
>
> >http://www.makotemplates.org/docs/
> > documentation.html#unicode_specifying
>
> > Like you would with a .py file.
>
> magic encoding is necessary, but also the stack trace above is
> occuring within the render() step, so ensure that any expressions ${}
> etc. which include non-ascii characters evaluate to a unicode value.
Sorry for not providing every detail up-front. The problem was caused
by a syntax error which caused Mako to fail when it tried to report
it.
Here is a minimal test case:
----- offending file -----
# -*- coding: utf-8 -*-
% if 2 == 2: # an innocently-looking comment
${u'привет'}
% endif
----------------------------------
If you replace unicode string with something ascii-safe you do get a
proper error from mako (CompileException).
Max.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---