Re: [Modeling-users] ZModelizationTool Importing into Zope failure
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-02-22 12:13:52
|
"W.J. MacIsaac" <wjm...@uc...> wrote: > I've gone wrong somewhere, but I'm at a loss as to say how. Can anyone > diagnose this? >=20 > Zope runs fine without trying to import the tool. >=20 > Thanks, > Jeff >=20 >=20 > [jeff@shackleton Zope-2.7.0]$ ./bin/runzope [...] > Traceback (most recent call last): > File "/usr/src/Zope-2.7.0/lib/python/OFS/Application.py", line 654, in = import_product > product=3D__import__(pname, global_dict, global_dict, silly) > File "/usr/src/Zope-2.7.0/Products/ZModelizationTool/__init__.py", line= 28, in ? > import ZModelizationTool > File "/usr/src/Zope-2.7.0/Products/ZModelizationTool/ZModelizationTool.= py", line 40, in ? > from Modeling.Entity import Entity > File "/usr/lib/python2.3/site-packages/Modeling/Entity.py", line 121, i= n ? > class Entity(base_object, XMLCapability, Persistent, KeyValueCoding): > TypeError: metaclass conflict: the metaclass of a derived class must be a= (non-strict) subclass of the metaclasses of all its bases My apologies for that, the responsability is defintiely on my side. Quick fix: edit Entity.py and change the line that says: ---- class Entity(base_object, XMLCapability, Persistent, KeyValueCoding): ---- into: ---- class Entity(XMLCapability, Persistent, KeyValueCoding): ---- ie: remove 'base_object' from the list of its superclass. Explanation: the patch for dynamic creation of modules from models which is included in 0.9pre17 also included some changes in the base classes of classes that are heavily used in the framework (among which: Entity), making them subclasses of 'object'. This is because new-style classes tends to run quicker then classic-styles. However, when ZODB is installed (and this is definitely the case in the ZModeler scope!), we get the "TypeError: metaclass conflict" exception for classes inheriting from both types.ObjectType and ZODB.Persistent (extension class). I should have detected this but forgot to run the tests with ZODB installed. This is now integrated into the shell script verifying releases' integrity, hopefully this won't happen anymore. Ticket #902106 has been created accordingly on sf.net. I'll try to make a new release ASAP, since this will affect every installation where ZODB is in the pythonpath (that's NOT a zope-only issue). Thanks for reporting! -- S=E9bastien. |