We are currently having the problem that installing Pylons breaks the TG 
1 nosetests. I'm getting the following error message:

 >     from turbogears import config
 > ImportError: cannot import name config

I think what happens is this (at least something similar):

* nosetests tries to load the turbogears package
* turbogears package loads turbogears.config
   via the nosetests importer
* nosetests loads the pylons plugin
* since the pylons plugin is in the pylons package,
   pylons is intialized; as part of that, pylons.templating
   is loaded, which in turn loads turbojson
* turbojson loads turbogears.config -> circular import

As a solution, the following 2 things should be fixed:

1) Moving the pylons nose plugin outside the pylons package,
    so that pylons it not always loaded whenever you run nose.
    This should probably suggested on the pylons mailing list.

2) The other problem is that TurboJson imports turbogears.config.
    Actually this is only used for customizing jsonify_sqlobject
    via the "turbojson.descent_bases" setting.
    The other settings are only used by the Buffet interface and
    since it gets the settings when it is instantiated, not when
    it is imported, this is not a problem.

I have currently no good idea how to solve 2). Maybe the generic jsonify 
function should become a method of GenericJSON instead, so you can 
access the JSONEncoder attributes including possible options?

Also, shouldn't descent_bases be renamed to "descend_bases" for 
grammatical reasons or even better "so_descend_bases" since it only 
affects SO? Is this setting even needed (I'm not using SQLObject)?

-- Christoph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to