[Modeling-users] Problems importing Modeling with ZODB 3.1.1 installed
Status: Abandoned
Brought to you by:
sbigaret
From: Ernesto R. <er...@si...> - 2003-09-16 19:46:08
|
Hi, just a little note if this issue haven't arosen yet. I've standalone ZODB 3.1.1 installed, running under Python 2.2 / Win32. When I do a=20 from Modeling.PyModel import * I get the following error: File "<stdin>", line 1, in ? File "c:\prg\python22\Lib\site-packages\Modeling\PyModel.py", line 57, = in ? from Entity import externalNameForInternalName File "c:\prg\python22\Lib\site-packages\Modeling\Entity.py", line = 1442, in ? finalize_docstrings(Entity, ENTITY_DOC) File "c:\prg\python22\Lib\site-packages\Modeling\utils.py", line 166, = in finalize_docstrings for n,m in inspect.getmembers(klass, inspect.ismethod): File "c:\prg\python22\lib\inspect.py", line 161, in getmembers value =3D getattr(obj, key) AttributeError: __call__ In Entity.py, Entity will now be a extension class, because of = Persistent (which is cPersistence.Persistent) and dir exposes an = attribute __call__, that when doing a getattr(Entity,'__call__') fails = in inspect.getmembers, inside the Python standard lib. To circumvate this I put a quick and dirty: raise 'Don't use ZODB'=20 near line 113 of Entity.py, in order to avoid ZODB Persistence = mechanism. Perhaps, this is a bug in Python 2.2 because: >>> import ZODB >>> from Persistence import Persistent >>> dir(Persistent) ['__basicnew__', '__call__', '__changed__', '__delattr__', '__doc__', = '__getattr__', '__getstate__', '__init__', '__module__', '__reduce__', = '__repr__', '__setattr__', '__setstate__', '_p_deactivate', = 'inheritedAttribute'] >>> getattr(Persistent,'__call__') Traceback (most recent call last): File "<interactive input>", line 1, in ? AttributeError: __call__ >>> I'll try Python 2.2.3 and tell you if the error persist. Erny |