I've just been getting to grips with Turbogears and it's going great for
me. Just been having a few problems, which I hope someone here can help
me with.
1) A long delay (~40s) at startup. When I run start-wiki20.py, these are
the last two lines of output:
2006-11-26 11:30:50,562 cherrypy.msg INFO CONFIG: server.thread_pool: 10
2006-11-26 11:31:31,687 cherrypy.msg INFO HTTP: Serving HTTP on
http://localhost:8080/
(notice the long gap). I'm just using the default sqlite database. I
have a reasonable pc (Athlon XP 2800, 1 gb) and the computer appears
idle during the time.
2) Trying to use Cheetah templates, I get lots of "name not found"
errors, for example the display() method on widgets. They work fine in
Kid. I wonder if this is a namemapper issue, I did notice a warning in
the output:
You don't have the C version of NameMapper installed! I'm disabling
Cheetah's useStackFrames option as it is painfully slow with the Python
version of NameMapper. You should get a copy of Cheetah with the
compiled C version of NameMapper.
I had a go at installing _namemapper.pyd, which seemed to get rid of
that warning message, but not the "name not found" errors!
3) With tgadmin sql I'm getting some sqlite errors (below) but it does
seem to perform the correct operations.
Exception exceptions.AttributeError: "'pysqlite2.dbapi2.Connection'
object has no attribute 'autocommit'" in <bound method
Transaction.__del__ of <sqlobject.dbconnection.Transaction object at
0x015C78F0>> ignored
4) There seems to be a bug in Catwalk, related to tables with joins.
Once a table that has a MultipleJoin had a child row created, it's no
longer possible to browse the parent table.
5) There is a minor bug in MSSQL support. You can only create one
database connection per Python instance, due to it's use of the
"sqlmodule" global variable internally. Not a problem for most apps, but
this really got me as I was figuring out the connection URL format.
Anyway, I hope these bug reports help, and I really hope someone can
help me, particularly with (1).
Cheers,
Paul
Do you have a network connection?
I notice this delay when there is no network.
--
Gregor
I also experience seriously long delays when starting my app without an
Internet connection.
Stuart
>>1) A long delay (~40s) at startup. When I run start-wiki20.py, these are
>>the last two lines of output:
>>
>>
>Do you have a network connection?
>I notice this delay when there is no network.
>
>
Yes, my computer is connected to the Internet, via a wireless NIC and a
router. The computer also has a couple of wired cards, neither enabled
at the moment. It is running Windows Firewall and ICS.
I wonder if this is a failing DNS lookup, or something. I ran Ethereal
while starting Turbogears, and it didn't generate any packets (and the
caputre was working, e.g. browsing is captured).
Is there some way I can increase the debugging in CherryPy, to narrow
down where the delay is happening?
Thanks for your help,
Paul
> 3) With tgadmin sql I'm getting some sqlite errors (below) but it does
> seem to perform the correct operations.
> Exception exceptions.AttributeError: "'pysqlite2.dbapi2.Connection'
> object has no attribute 'autocommit'" in <bound method
> Transaction.__del__ of <sqlobject.dbconnection.Transaction object at
> 0x015C78F0>> ignored
this is one of those "noone really knows what's happening issue" do a
search on the wiki for
"'pysqlite2.dbapi2.Connection' object has no attribute 'autocommit'"
or in google there is a wiki page on trac with this.
> 5) There is a minor bug in MSSQL support. You can only create one
> database connection per Python instance, due to it's use of the
> "sqlmodule" global variable internally. Not a problem for most apps, but
> this really got me as I was figuring out the connection URL format.
you may want to redirect that to the SO list, the maintainer of the
module could reply.
This is a Cheetah bug, related to the auto-calling feature of the namemapper:
http://sourceforge.net/mailarchive/message.php?msg_id=30070548
For a workaround, see my Cheetah custom filter here:
http://docs.turbogears.org/1.0/AdvancedCheetahTemplates#the-template-base-class
Alternatively, you could probably just turn off auto-calling completely (untested).
Chris
>>>1) A long delay (~40s) at startup. When I run start-wiki20.py, these are
>>>the last two lines of output:
>>>
>>o you have a network connection?
>>I notice this delay when there is no network.
>>
>>
>I also experience seriously long delays when starting my app without an
>Internet connection.
>
>
I took a look into CherryPy and found that the slow call is in
_cpwsgiserver.py
info = socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM)
In my setup it's getting called with host="" port=8080. This call takes
about 40s on its own. If I use None instead of "" it returns
immediately. The results are slightly different:
host = None
[(2, 1, 0, '', ('127.0.0.1', 8080))]
host = ""
[(2, 1, 0, '', ('192.168.2.100', 8080))]
So, my first attemt at this is to add the following line to
_cpwsgiserver.py, just before socket.getaddrinfo
if not host: host = None
With this tweak my Turbogears apps start up much quicker! I'm not sure
if this fix is the best fix (hopefully someone more knowledgeable of TG
will read this), but it does seem to work.
Hope this helps someone,
Paul
I'm new to Cheetah so this question may seem lame. :-) How did you
install the _namemapper.pyd file. I downloaded it from Cheetah but
don't know how to install it. Cheetah made it seem all I had to do was
to copy it to the root Cheetah folder. BTW, I'm using Python 2.5 on
Windows.
Thanks,
Dax