[ZODB-Dev] cPickle: state is not a directory/Upgrade to Zope 2.7failing

Tim Peters tim at zope.com
Tue Nov 4 12:23:53 EST 2003


[Tim Peters]
>> This pickle creates a DateTime object, and then *tries* to set its
>> state from a tuple.  That's not legal -- a tuple makes no sense here.

[Jim Fulton]
> That's a little missleading. The state can be anything. as long as
> the class provides __setstate__ method that handles it.

In the full context there is no __setstate__ method for this class (else we
would not have gotten into the code trying to treat the state as a dict,
that being effectively the default __setstate__ implementation).

> It looks as though this pickle was written from a DateTime class with
> custom __getstate__ and __setstate__.  This would be useful to save
> space. I can find no evidence of this in CVS though.

More, the DateTime instance ends up being attached to attribute
'lastRegistered', and there's no code in Zope or CMF that binds
lastRegistered to anything other than an instance of a DateTime imported via

    from DateTime import DateTime

> Is it possible that sombody had installed such an optimization in Adreas'
> Zope 2.6 installation?

Andreas?  That's the only plausible explanation I can see -- Zope's native
DateTime class doesn't produce pickles like the one you sent.

> If so, somebody needs to migrate that forward to the 2.7 installation.




More information about the ZODB-Dev mailing list