Re: Cheetah completely borked under python 2.7?
Jon Siddle <[email protected]> Tue, 12 Oct 2010 14:08:17 +0100
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
The remaining failures (6 of them) are line endings tests. Python 2.7
changed the behaviour of the compile() builtin (change documented
at http://docs.python.org/dev/whatsnew/2.7.html). The following
minimally reproduces the change:
c = compile('x="""\r\nx\r\n"""', 'file', 'exec')
exec(c, globals(), locals())
print x == "\nx\n"
Under 2.7 this prints "True". Under earlier versions of python, it prints
"False".
I can't see a way round this short of replacing all in-string literal
newlines
with "\r\n" or "\r". This would require pre-parsing the template to find
the strings. Hopefully there's a nicer way.
We don't actually care that literal line endings get converted to UNIX
line endings; does this matter to anyone? Would it be easier to require
non-UNIX line endings to be escaped?
Thanks
Jon
On 04/10/10 21:26, Mike Bonnet wrote:
> I just built Cheetah and ran the unit tests under python 2.7 (Fedora 14
> Beta) and it spewed a ton of errors. I haven't had a chance to look
> into them yet, but they look pretty concerning. Has anyone seen these
> problems yet? Are we going to need serious refactoring to make Cheetah
> work under python 2.7?
>
> The log is available here:
>
> http://people.redhat.com/mikeb/cheetah-2.4.3-python27-tests.log
>
> I'll start looking into possible fixes when I can.
>
> Thanks,
> Mike
>
> ------------------------------------------------------------------------------
> Virtualization is moving to the mainstream and overtaking non-virtualized
> environment for deploying applications. Does it make network security
> easier or more difficult to achieve? Read this whitepaper to separate the
> two and get a better understanding.
> http://p.sf.net/sfu/hp-phase2-d2d
> _______________________________________________
> Cheetahtemplate-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb