[Zope] UnpickleableError with objects derived from Sync.Synchronized

Chris McDonough chrism@zope.com
Tue, 29 Jan 2002 09:36:09 -0500


Looks like you can't use Sync.Synchronized then. ;-)  You'll need to 
manage thread locks manually.

Alexei Ustyuzhaninov wrote:
> OK, but it seems to me that the unpickleable object resides in 
> Sync.Synchronized. Without mixing in this class objects of my class are 
> created easily (though have problems with multithreading lately).
> 
> Chris McDonough wrote:
> 
>> This signifies that your instance has a reference to another object 
>> that cannot be pickled.  For a list of items that are pickleable (and 
>> therefore storable in the ZODB), see the Python documentation.
>>
>> Alexei Ustyuzhaninov wrote:
>>
>>> Hi!
>>>
>>> I have objects in my product which shouldn't be accessed 
>>> simultaneously by different threads. So I mixed their class in the 
>>> Sync.Synchronized class as recommended in 
>>> http://www.zope.org/Documentation/How-To/ThreadSafety. But now I 
>>> can't even create the objects because of UnpickleableError:
>>>
>>> Traceback (innermost last):
>>>   File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in 
>>> publish_module
>>>   File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in 
>>> publish
>>>   File /usr/lib/zope/lib/python/Zope/__init__.py, line 226, in 
>>> zpublisher_exception_hook
>>>   File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 175, in 
>>> publish
>>>   File /usr/lib/zope/lib/python/Zope/__init__.py, line 240, in commit
>>>   File /usr/lib/zope/lib/python/ZODB/Transaction.py, line 302, in commit
>>>   File /usr/lib/zope/lib/python/ZODB/Connection.py, line 418, in commit
>>>     (Info: (('Products.Tap3Editor.tap3editor', 'tap3editor'), 
>>> '\x00\x00\x00\x00\x00\x00j\x08', ''))
>>> UnpickleableError: (see above)
>>>
>>> I use zope 2.4.2 for linux from debian binary distribution.
>>>
>>> So could someone explain what's the problem here?
>>
> 
>