On Friday, January 3, 2003, at 12:33  PM, Dieter Maurer wrote:

Sean Gillies wrote at 2003-1-2 12:52 -0700:
My question concerns the use of SWIG Python proxy classes in a
Zope Product.  In the ZDG and elsewhere, I have seen the statement
that if an object is pickleable, it can be used as a persistent
object in a Zope Product.  In my experience, my SWIG Python proxy
classes are pickleable, can be stored in a ZODB, the Product that
uses them can be installed in Zope, instances of the Product
classes can be added and work, but on a restart of Zope, the
instances of my Product classes are broken and will cause Zope
to segfault on any attempt to access the proxy class.  I am
using Python 2.1.3 with threads and the thread stack size patch
built on OS X 10.2 and Zope 2.6.0.  I've had no other problems
with Python or Zope on this machine until I began developing this
new Product.
Sounds like an "unpickling" problem.

For security reasons, "unpickling" is quite restricted.
Objects must have special declarations to be "unpicklable".

Try to unpickle your objects and see whether this produces any errors.


Dieter

Dieter,

Thanks for taking time to reply.

I am able to unpickle the object without any problems. I am
also able to save the object to a FileStorage using ZODB and
can load it again from the database without problems. There
must be more to it in Zope?

I found a Product that also uses SWIG (m2crypto) and am going
to look through it to see if I'm missing anything.

cheers,
Sean


_______________________________________________
Zope-Dev maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )

Reply via email to