Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

Weird error

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


charlie at begeistert

Apr 17, 2008, 4:52 AM

Post #1 of 1 (93 views)
Permalink
Weird error

Hi,

whilst trying out some Zope 3 stuff (implementedBy, providedBy) I
managed to screw up some portal objects but I'm not quite sure how and
I've no idea how to fix them.

I effectively did something like:

for obj in folder.contentValues:
if IMyInterface.implementedBy(obj):
do_something_with_object()

If I understand things correctly this should not affect the objects
themselves at all but it does and leads to the following error when I
subsequently try and access them.

Traceback (most recent call last):
File "/opt/Zope-2.10/lib/python/ZODB/Connection.py", line 761, in
setstate
self._setstate(obj)
File "/opt/Zope-2.10/lib/python/ZODB/Connection.py", line 819, in
_setstate
self._reader.setGhostState(obj, p)
File "/opt/Zope-2.10/lib/python/ZODB/serialize.py", line 604, in
setGhostState
state = self.getState(pickle)
File "/opt/Zope-2.10/lib/python/ZODB/serialize.py", line 597, in
getState
return unpickler.load()
File "/opt/Zope-2.10/lib/python/zope/interface/declarations.py",
line 352, in implementedByFallback
raise TypeError("ImplementedBy called for non-factory", cls)
TypeError: (<exceptions.TypeError instance at 0x348cc88>, <built-in
function implementedBy>, (<Container at >,))

Any idea how I can fix this?

It turns out that I need to use .providedBy() rather
than .implementedBy() although I'm not too clear of the distinction.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



_______________________________________________
Zope-CMF maillist - Zope-CMF[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.