python 2.5 on windows

11 views
Skip to first unread message

Florent Aide

unread,
Feb 2, 2007, 7:41:44 PM2/2/07
to turbogea...@googlegroups.com
Hello fellow list posters/readers,

I have been playing a bit with TG dev on windows and was naturally
tempted to try and install TG on python 2.5.

To tell you the truth I am trying to make it work in Portable Python
(which uses 2.5). I have created my own portable python on 2.4 to test
and everything works like a charm.

Now on 2.5 I have succeeded in installing every required component (at
least is seems so).
I had to download pyprotocols and ruledispatch from svn but got them
compiled using visual studio .net 2003.

When I launched tg-admin quickstart I got this error:

---------------
File "x:\ppython\lib\site-packages\cheetah-1.0-py2.5.egg\Cheetah\Parser.py", l
ine 32, in <module>
from Cheetah import ErrorCatchers
File "x:\ppython\lib\site-packages\cheetah-1.0-py2.5.egg\Cheetah\ErrorCatchers
.py", line 16, in <module>
from Cheetah.NameMapper import NotFound
File "x:\ppython\lib\site-packages\cheetah-1.0-py2.5.egg\Cheetah\NameMapper.py
", line 146
from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file
---------------

Just moved the import line a the top of the file in NameMapper.py to
make it work...

then
---------------
File "x:\ppython\lib\site-packages\turbogears-1.0.1-py2.5.egg\turbogears\widge
ts\meta.py", line 194, in load_kid_template
return (kid.load_template(t, name=modname).Template, t)
File "x:\ppython\lib\site-packages\kid-0.9.5-py2.5.egg\kid\__init__.py", line
158, in load_template
store=cache, ns=ns, exec_module=exec_module)
File "x:\ppython\lib\site-packages\kid-0.9.5-py2.5.egg\kid\importer.py", line
144, in _create_module
raise_template_error(module=name, filename=filename)
File "x:\ppython\lib\site-packages\kid-0.9.5-py2.5.egg\kid\codewriter.py", lin
e 94, in raise_template_error
encoding = mod.encoding
AttributeError: 'module' object has no attribute 'encoding'
---------------

Module in question is : turbogears.widgets.base.CSSLink.Template

commented lines 91 to 97 in codewriter.py to bypass the obvious problems

then I got:

---------------
from turbogears.widgets.base import *
File "x:\ppython\lib\site-packages\turbogears-1.0.1-py2.5.egg\turbogears\widge
ts\base.py", line 507, in <module>
class CSSLink(Link):
File "x:\ppython\lib\site-packages\turbogears-1.0.1-py2.5.egg\turbogears\widge
ts\meta.py", line 76, in __init__
cls.template) = load_kid_template(cls.template, modname)
File "x:\ppython\lib\site-packages\turbogears-1.0.1-py2.5.egg\turbogears\widge
ts\meta.py", line 194, in load_kid_template
return (kid.load_template(t, name=modname).Template, t)
File "x:\ppython\lib\site-packages\kid-0.9.5-py2.5.egg\kid\__init__.py", line
158, in load_template
store=cache, ns=ns, exec_module=exec_module)
File "x:\ppython\lib\site-packages\kid-0.9.5-py2.5.egg\kid\importer.py", line
144, in _create_module
raise_template_error(module=name, filename=filename)
File "x:\ppython\lib\site-packages\kid-0.9.5-py2.5.egg\kid\importer.py", line
141, in _create_module
exec code in mod.__dict__
File "<string>", line 5, in <module>
SystemError: Parent module 'turbogears.widgets.base.CSSLink' not loaded
---------------

At this point I decided it was time to checkout the svn head again :)

I then started to use the trunk version of TG to do my tests and here
are my results:

I had to do 2 things:

1 - install sqlobject 0.8x because on 2.5 sqlite module is renamed
sqlite3 but this is a
minor issue (I had to remove the dependencies in the requirements)

2 - amend was the master.kid file to read:
py:if="hasattr(self, 'tg_flash')" instead of just
py:if="tg_flash" on line 36.

Apart from that I had a running tg site on 2.5 on windows (tested with
SO and SA but just the quickstart site)

When I had this quickstart sites running I tested the application I am
working on at the moment and it worked like a charm. So for me the
1.1-head branch "seems" python 2.5 ready!

Regards,

Florent Aide

ps:
Since I have VS2003 at my disposition I can provide ruledispatch and
pyprotocols eggs (or other tg related eggs) for win32 on python 2.5 if
someone is interested.

Mark Ramm

unread,
Feb 2, 2007, 10:53:26 PM2/2/07
to turbogea...@googlegroups.com
This is fantastic news.  Thanks for doing the work to try all of this out.

And I think compiled binary eggs for Rule Dispatch for windows are a great contribution.

If you could throw create a ticket for a 2.5 version, you can attach the eggs there, and Lee or one of the other folks can work out where to host these on the site.  

--Mark Ramm

  File "x:\ppython\lib\site-packages\turbogears- 1.0.1-py2.5.egg\turbogears\widge



--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

Florent Aide

unread,
Feb 3, 2007, 1:35:12 PM2/3/07
to turbogea...@googlegroups.com
On 2/3/07, Mark Ramm <mark.mch...@gmail.com> wrote:
> If you could throw create a ticket for a 2.5 version, you can attach the
> eggs there, and Lee or one of the other folks can work out where to host
> these on the site.

done it is here :
http://trac.turbogears.org/ticket/1280

Cheers,

Florent.

Elvelind Grandin

unread,
Feb 3, 2007, 1:56:24 PM2/3/07
to turbogea...@googlegroups.com
they have been added now to the site. Thanks for providing them!


--
cheers
elvelind grandin

gas...@gmail.com

unread,
Feb 5, 2007, 10:04:44 PM2/5/07
to TurboGears Trunk
my post was disappeared so I'd repost again shortly:


> SyntaxError: from __future__ imports must occur at the beginning of the file
> ---------------
> Just moved the import line a the top of the file in NameMapper.py to
> make it work...


It could be solved by install cheetah 2.0

> AttributeError: 'module' object has no attribute 'encoding'
> ---------------
>
> Module in question is : turbogears.widgets.base.CSSLink.Template
>
> commented lines 91 to 97 in codewriter.py to bypass the obvious problems
>


It's valid


> File "<string>", line 5, in <module>
> SystemError: Parent module 'turbogears.widgets.base.CSSLink' not loaded
> ---------------

It works in trunk but not in 1.0 branch, and it looks like a widget
problem. So once the widget is recovered in trunk, the same problem
may occured there.

>
> 1 - install sqlobject 0.8x because on 2.5 sqlite module is renamed
> sqlite3

Valid

> 2 - amend was the master.kid file to read:
> py:if="hasattr(self, 'tg_flash')" instead of just
> py:if="tg_flash" on line 36.

I got a different result, in py 2.5 it seems need supply tg_flash
explicitly for return value, or it will bark a exception.


Over all, thanks for make TG + py2.5 possible!

--
Fred

Florent Aide

unread,
Feb 6, 2007, 3:55:04 AM2/6/07
to turbogea...@googlegroups.com
>
> > 2 - amend was the master.kid file to read:
> > py:if="hasattr(self, 'tg_flash')" instead of just
> > py:if="tg_flash" on line 36.
>
> I got a different result, in py 2.5 it seems need supply tg_flash
> explicitly for return value, or it will bark a exception.
>

doing an hasattr(self, 'tg_flash') takes care of not raising an
exception if tg_flash was not provided to the view. Do you mean there
could be some other problem ?

Florent.

gas...@gmail.com

unread,
Feb 6, 2007, 5:09:05 AM2/6/07
to TurboGears Trunk
> doing an hasattr(self, 'tg_flash') takes care of not raising an exception if tg_flash was not provided to the view.

After checked again these is valid,

>Do you mean there could be some other problem ?

because I type the double quote :P

Kevin Dangoor

unread,
Feb 6, 2007, 6:50:09 AM2/6/07
to turbogea...@googlegroups.com
Hi Florent,

Thanks for getting TG running with 2.5! That's most excellent news!

I should mention that it would be good to have a 2.5 egg for Cheetah with the compiled _namemapper.pyd. Cheetah is dog slow without it. That may not matter for quickstart, but it does matter if someone actually tries to use their installed Cheetah to serve  up pages.

Kevin

Florent Aide

unread,
Feb 6, 2007, 7:38:41 AM2/6/07
to turbogea...@googlegroups.com
On 2/6/07, Kevin Dangoor <dan...@gmail.com> wrote:

> Thanks for getting TG running with 2.5! That's most excellent news!

[...]

> I should mention that it would be good to have a 2.5 egg for Cheetah with
> the compiled _namemapper.pyd. Cheetah is dog slow without it. That may not
> matter for quickstart, but it does matter if someone actually tries to use
> their installed Cheetah to serve up pages.

[...]

I'll look into this :)

Cheers,

Florent.

Florent Aide

unread,
Feb 6, 2007, 8:07:32 AM2/6/07
to turbogea...@googlegroups.com

There is a maximum attachement size in trac and the Cheetah egg is
bigger ... should I post this here ?

Florent.

Jorge Godoy

unread,
Feb 6, 2007, 8:53:27 AM2/6/07
to turbogea...@googlegroups.com
"Florent Aide" <floren...@gmail.com> writes:

> There is a maximum attachement size in trac and the Cheetah egg is
> bigger ... should I post this here ?

I don't believe it will make through... You can send it to me and I'll put on
my machine until someone puts it on TG's website.


--
Jorge Godoy <jgo...@gmail.com>

Florent Aide

unread,
Feb 6, 2007, 9:13:12 AM2/6/07
to turbogea...@googlegroups.com
On 2/6/07, Jorge Godoy <jgo...@gmail.com> wrote:

[...]

> I don't believe it will make through... You can send it to me and I'll put on
> my machine until someone puts it on TG's website.

done

Christopher Arndt

unread,
Feb 6, 2007, 10:37:32 AM2/6/07
to turbogea...@googlegroups.com
Kevin Dangoor schrieb:

> Thanks for getting TG running with 2.5! That's most excellent news!

Could somebody with an overview about the current situation update
http://docs.turbogears.org/1.0/Python2.5Support, especially the table with the
component support?

Ths, Chris

Jorge Godoy

unread,
Feb 6, 2007, 11:34:10 AM2/6/07
to turbogea...@googlegroups.com
"Florent Aide" <floren...@gmail.com> writes:

It is at http://home.g2ctech.com/~godoy/Cheetah-2.0rc7-py2.5-win32.egg


I'll leave it there for a while, but it would be nice if this was moved to
TG's page.

--
Jorge Godoy <jgo...@gmail.com>

gas...@gmail.com

unread,
Feb 6, 2007, 11:35:41 AM2/6/07
to TurboGears Trunk
> Could somebody with an overview about the current situation updatehttp://docs.turbogears.org/1.0/Python2.5Support, especially the table with the component support?

Updated.

And I made a setup.py candidate for py2.5 on http://
trac.turbogears.org/ticket/1119


The last thing is to check why widget bark this error for kid in py
2.5:

Florent Aide

unread,
Feb 6, 2007, 3:44:09 PM2/6/07
to turbogea...@googlegroups.com
On 2/6/07, gas...@gmail.com <gas...@gmail.com> wrote:
>
> The last thing is to check why widget bark this error for kid in py
> 2.5:


I got it !

http://trac.turbogears.org/ticket/1288

I know have a working 1.0.1 on python 2.5 / win32

I only have a sqlalchemy installation though. Could someone please
test with a real SO project to confirm its working ?

Cheers,

Florent

gas...@gmail.com

unread,
Feb 6, 2007, 10:16:52 PM2/6/07
to TurboGears Trunk
>
> > The last thing is to check why widget bark this error for kid in py
> > 2.5:
>
> I got it !
>
> http://trac.turbogears.org/ticket/1288
>

Cool, it works!

> I know have a working 1.0.1 on python 2.5 / win32
>
> I only have a sqlalchemy installation though. Could someone please
> test with a real SO project to confirm its working ?
>

I've tested the whatwhat status(SQLObject), and it works :)

But the trunk didn't fit your patch since widget code is varied.


Here's my package lists:

TG 1.0.2 in svn
cheetah-2.0rc7-py2.5.egg
cherrypy-2.2.1-py2.5.egg
FormEncode-0.6.1 dev
kid-0.9.5-py2.5.egg
paste-1.2.1-py2.5.egg
pastedeploy-1.1-py2.5.egg
pastescript-1.1-py2.5.egg
SQLObject-0.8.0b2-py2.5.egg
turbocheetah-0.9.5-py2.5.egg
turbojson-1.0-py2.5.egg
turbokid-0.9.9-py2.5.egg
elementtree-1.2.6_20050316-py2.5-win32.egg
PyProtocols-1.0a0-py2.5-win32.egg
RuleDispatch-0.5a0.dev-py2.5-win32.egg
setuptools-0.6c5-py2.5.egg
simplejson-1.5-py2.5.egg


haroldm...@gmail.com

unread,
Feb 7, 2007, 12:02:02 PM2/7/07
to TurboGears Trunk
What would be the problem with the following:
cherrypy-3.0.0-py2.5.egg
paste-1.2.1-py2.5.egg ?

haroldm...@gmail.com

unread,
Feb 7, 2007, 12:06:25 PM2/7/07
to TurboGears Trunk
Sorry, I misread your list concerning Paste, so it's down to CherryPy
3.0!


On Feb 7, 11:02 am, "haroldmarsh...@gmail.com"

gas...@gmail.com

unread,
Feb 7, 2007, 1:58:29 PM2/7/07
to TurboGears Trunk
Try to patch the 1.0.x setup.py to install TG on py2.5.

http://trac.turbogears.org/attachment/ticket/1119/py25.2.patch

Now the setup.py won't effect people < 2.5.

And you've to "easy_install -U cheetah" to download cheetah 2.0 to
avoid modify the code.

If the code worked I'll check it in svn. (and update turboCheetah with
the same way that won't effect people < 2.5)

Or if someone can prove that SQLObject 0.8/cheetah 2.0 won't hurt TG
after bumping up the version, we could make the setup.py simpler.

To haroldmarshall:
CP3 porting is another issue (it belongs to TG 1.1), and it doesn't
matter to TG's Py 2,5 compatibility.

Reply all
Reply to author
Forward
0 new messages