[ZPT] Re: Trailing newline added by TALInterpreter.__call__()
Alexander Limi
limi at plone.org
Sat Jul 3 19:55:14 EDT 2004
On Wed, 09 Jun 2004 11:19:13 -0500, Evan Simpson <evan at 4-am.com> wrote:
> Fred Drake wrote:
>> The TALInterpreter class is very careful to add a trailing newline at
>> the end of a rendering if there isn't one already present. This
>> vaguely feels like something that was done to make the user experiance
>> nicer for someone working with the templates in an editor, but there's
>> no comment explaining it in the code.
>
> Nope, it was done because of this:
>
> >>> exec('''if 1:\n print 1''')
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "<string>", line 2
> print 1
> ^
> SyntaxError: invalid syntax
> >>> exec('''if 1:\n print 1\n''')
> 1
>
> This was fixed in Python 2.3, apparently, so the code can probably be
> removed.
I buy a beer for the one that fixes this. It's the single most annoying
thing with ZPT right now (and lack of DOCTYPE suppport is next on the list
:).
Pretty please? :)
--
__________________________________________________________________
Alexander Limi · Chief Architect · Plone Solutions
Development · Training · Support · http://www.plonesolutions.com
__________________________________________________________________
Plone Co-Founder · http://plone.org · Connecting Content
More information about the ZPT
mailing list