symbols undefined after product refresh?
hi! after reloading my own products through the zmi it seems like some classes and methods gets undefined. please see the following traceback: ... Module Python expression "here.zuml_parseAndCheckinModel(newConfigDict)", line 1, in <expression> Module Products.IDE.IDEContainer, line 176, in zuml_parseAndCheckinModel Module Products.Relateable.MetaManager, line 474, in recreateIndexes Module None, line 104, in addSubClassCatalogMethod TypeError: 'NoneType' object is not callable the code @ line 104 is: o = SubClassCatalog(id, searchKeys, subClassNames) SubClassCatalog is defined in /Products/SubClassCatalog/SubClassCatalog.py, after I refresh the Product "SubCLassCatalog", i get the error mentioned above. restarting Zope fixes the Problem, MetaManager::recreatedIndexes() will work repeatedly until i refresh one or more Products... did i miss something while importing stuff? /Products/relateable/MetaManager.py imports the constructor for a SubClassCatalog like this: from Products.SubClassCatalog.SubClassCatalog import addSubClassCatalogMethod i'm pretty puzzled at this point, hope someone got a hint... regards, juergen herrmann ps: this does not only happen to my SubClassCatalog, this also hits f.ex. "from random import randint" where randint gets undefined.
On Apr 8, 2005, at 15:20, Jürgen Herrmann wrote:
hi!
after reloading my own products through the zmi it seems like some classes and methods gets undefined. please see the following traceback:
Refresh is *not* the panacea to avoid all restarts. If things get funky, restart. Simple as that. jens
On Apr 8, 2005 3:20 PM, Jürgen Herrmann <Juergen.Herrmann@xlhost.de> wrote:
TypeError: 'NoneType' object is not callable
This means that one module that needed to be reloaded either did not get reloaded or was reloaded before the module from where it is called. Exactly why this happens is hard to say, but it happens very often where you have many modules that are dependent on each other. Refresh basically is a bit of a pain to use on any module who contains some sort of "core" functionality that other modules use. In principal you need to refresh every module that uses the module that was refreshed, and all modules that uses these modules. In the right order. Quite often, no matter what you try, it will fail. In that case: restart. The best way to avoid refresh-problems when debugging is to actually use unit test, and thus avoid the whole issue... -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
On Fri, Apr 08, 2005 at 03:20:52PM +0200, Jürgen Herrmann wrote: [...] | ps: this does not only happen to my SubClassCatalog, this also hits | f.ex. "from random import randint" where randint gets undefined. That makes sense. The 'from-import' syntax creates a name in the local namespace that refers to the indicated object. If you reload the module you imported from, then that object is going to go away (or at least be re-constructed) and the reference you had may no longer be valid. It may be the case that reloading your module fails to properly handle all of the imports. Basically that's just the way it is and it is difficult to try and implement reload completely correctly (which is what Zope's refresh depends on ). As has already been noted, simply restart and you definitely won't have any problems. Use a faster machine if the restart time is too long ;-). HTH, -D -- One OS to rule them all, one OS to find them, One OS to bring them all and in the darkness bind them, In the Land of Redmond, where the Shadows lie. www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org
participants (4)
-
Derrick Hudson -
Jens Vagelpohl -
Jürgen Herrmann -
Lennart Regebro