Re: Cheetah completely borked under python 2.7?

Jon Siddle <[email protected]> Tue, 12 Oct 2010 14:01:28 +0100
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
   There are 35 errors caused by a python version check which breaks 
under 2.7

See attached for a simple patch to fix it.

More details about the change in 2.7 which broke it here: 
http://bugs.python.org/issue4285

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

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
0001-sys.version_info-isn-t-a-tuple-in-2.7.-Fix-version-c.patch (text/plain, 704 B)
>From d36aeb8cc36ff7e0bc92663312a8e32dcbf2ef27 Mon Sep 17 00:00:00 2001
From: Jon Siddle <[email protected]>
Date: Tue, 12 Oct 2010 13:37:06 +0100
Subject: [PATCH] sys.version_info isn't a tuple in 2.7. Fix version check in Template.py

---
 cheetah/Template.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cheetah/Template.py b/cheetah/Template.py
index f42f77b..10ced89 100644
--- a/cheetah/Template.py
+++ b/cheetah/Template.py
@@ -32,7 +32,7 @@ except ImportError:
 
 filetype = None
 
-if isinstance(sys.version_info, tuple):
+if isinstance(sys.version_info[:], tuple):
     # Python 2.xx
     filetype = types.FileType
     def createMethod(func, cls):
-- 
1.7.2.3