- attached zope-iface-getattr.patch
patch for issue related to zope.interface
See http://comments.gmane.org/gmane.comp.python.zope.interface/241; SQLAlchemy gives this error:
File "/home/johnt/.buildout/eggs/SQLAlchemy-0.6beta2-py2.4.egg/sqlalchemy/ext/declarative.py", line 712, in init _as_declarative(cls, classname, cls.dict) File "/home/johnt/.buildout/eggs/SQLAlchemy-0.6beta2-py2.4.egg/sqlalchemy/ext/declarative.py", line 548, in _as_declarative obj = getattr(base,name) ConfigurationExecutionError: exceptions.AttributeError: provides in: File "/home/johnt/.buildout/eggs/hc.site.usersdb-1.0.2dev_r21543-py2.4.egg/hc/site/usersdb/configure.zcml", line 8.2-11.8 ...
So zope.interface is causing problems with getattr(); the attached patch makes it getattr(base,name,None). I have a patch that I will try to attach to this ticket (crosses fingers).
Comments (8)
-
Account Deleted -
repo owner - changed milestone to 0.6.0
its fine but needs a test in test.ext.test_declarative on a class that overrides
__getattribute__
, probably raises an error on a certain attribute name. -
Account Deleted Replying to zzzeek:
its fine but needs a test in test.ext.test_declarative on a class that overrides
__getattribute__
, probably raises an error on a certain attribute name.I'll give it a shot.
-
Account Deleted Replying to guest:
Replying to zzzeek:
its fine but needs a test in test.ext.test_declarative on a class that overrides
__getattribute__
, probably raises an error on a certain attribute name.I'll give it a shot.
The getattr() in _as_declarative is looking at class attributes, not instance attributes. It's not immediately obvious to me how to create on that shows up in dir(), but throws an error in getattr(). Ideas?
-
repo owner well this is the thing. What's Zope doing that requires this change ?
-
Account Deleted Replying to zzzeek:
well this is the thing. What's Zope doing that requires this change ?
zope.interface is adding this crazy {{{provides}}} class attribute that shows up in dir(), but {{{getattr(cls,"provides")}}} throws {{{AttributeError}}}.
-
repo owner - changed status to resolved
good test, I was having trouble getting it to work myself (same idea though). This is in 03573c0517dc27f90f1a07ef8ad67a0692977a24
-
repo owner - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
zope interface patch