On Wednesday 19 April 2006 21:37, Jorge Vargas wrote:
> yes that is exactly waht Rob was talking about there was a change in the
> file extensions in 0.9a1 which was reverted in 0.9a2

Let me clarify then.  Without having -ANY- TG site set up, say, just after 
getting the latest SVN and friends set up in "develop" mode, I run 'sudo python 
setup.py deveop' in my TG-Content package.  I then enter a scratch directory 
and run tg-admin with no arguments.  It dies.

The problem has to do with how TurboGears attempts to automatically provide a 
DB connection.  It does so (and of course dies if no configuration is set up) 
but the strangeness is that only InheritableSQLObjects are causing the error.

Fromwhat I can tell of Identity, how an application accesses the configuration 
setting has not changed, only how that setting is set in the first place.

After some experimenting with the "comment-out-all-then-work-backwards" school 
of debugging I have narrowed the problem down.

After dropping content.components registration from setup.py (and 
re-installing) the following in my content.model:

        class Test(InheritableSQLObject):
                pass

        class Bob(Test):
                pass

Reproduces the error thus:

Traceback (most recent call last):
  File "/usr/bin/tg-admin", line 7, in ?
    sys.exit(
  File 
"/usr/lib/python2.4/site-packages/setuptools-0.6a11-py2.4.egg/pkg_resources.py",
 line 236, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File 
"/usr/lib/python2.4/site-packages/setuptools-0.6a11-py2.4.egg/pkg_resources.py",
 line 2097, in load_entry_point
    return ep.load()
  File 
"/usr/lib/python2.4/site-packages/setuptools-0.6a11-py2.4.egg/pkg_resources.py",
 line 1830, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/mbevan/Projects/turbogears/turbogears/__init__.py", line 18, in ?
    ext = entrypoint.load()
  File 
"/usr/lib/python2.4/site-packages/setuptools-0.6a11-py2.4.egg/pkg_resources.py",
 line 1830, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/mbevan/Projects/TG-Content/content/__init__.py", line 23, in ?
    from content import controllers, model, widgets
  File "/home/mbevan/Projects/TG-Content/content/model.py", line 16, in ?
    class Bob(Test):
  File 
"/home/mbevan/Projects/turbogears/thirdparty/sqlobject/sqlobject/declarative.py",
 line 108, in __new__
    cls.__classinit__(cls, new_attrs)
  File 
"/home/mbevan/Projects/turbogears/thirdparty/sqlobject/sqlobject/main.py", line 
748, in __classinit__
    if not connection and not getattr(cls, '_connection', None):
  File "/home/mbevan/Projects/turbogears/turbogears/database.py", line 148, in 
__get__
    self.set_hub()
  File "/home/mbevan/Projects/turbogears/turbogears/database.py", line 166, in 
set_hub
    raise KeyError, "No database configuration found!"
KeyError: 'No database configuration found!'

Lines 748-753 of sqlobject/main.py attempt to pull a connection instance from 
the class's _connection property, then from '__connection' in the the module 
containing the class.  The act of testing the boolean value of 'connection' 
(set to the DB hub) attempts to open a connection, unless I am mistaken.

*sigh* I don't know what changed, but I will again try to narrow down which 
specific SVN change caused the problem.  Time for some more coffee...

What revision in SVN was 0.9a0?

 - Matthew

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to