collective / collective.alias

3 stars 5 forks source link

Utility of __class__ and PicklingError #10

Open Gagaro opened 8 years ago

Gagaro commented 8 years ago

Hi,

What is the exact use of https://github.com/collective/collective.alias/blob/master/src/collective/alias/content.py#L259-L274 ? From what I understand, it allow the alias to have the methods/attributes of the aliased, but is it absolutely necessary with the __getattr__ ?

I'm asking because I have the following error with the plone5 branch et on plone 5 rc2:

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  [...]
  Module transaction._transaction, line 690, in __init__
  Module ZODB.Connection, line 1123, in savepoint
  Module ZODB.Connection, line 623, in _commit
  Module ZODB.Connection, line 658, in _store_objects
  Module ZODB.serialize, line 422, in serialize
  Module ZODB.serialize, line 431, in _dump
PicklingError: Can't pickle <class 'collective.alias.content.Alias'>: it's not the same object as collective.alias.content.Alias

Thanks for the help.

rafaelbco commented 8 years ago

For the record: this bug also occurs in Plone 4.3.9 when the aliased content is from plone.app.contenttypes. Looking at the traceback it seems to be related to versioning.