[zope2-tracker] [Bug 735999] [NEW] Zope 2.12 PythonScript manage_change_history_page functionalities broken for old objects

Vincent Pelletier 735999 at bugs.launchpad.net
Wed Mar 16 05:19:16 EDT 2011


Public bug reported:

How to reproduce:
- Create an instance with an old Zope version (in my case: 2.8.8)
- Create a PythonScript object, maybe edit a few times (just to have more than one revisions, to show the problem is not an edge case of a new object)
- Upgrade to newer Zope (in my case: 2.12)
- Go to the same PythonScript, maybe edit again a few times (same goal as above)
- Go to History page
- Try to diff script with an old revision of itself, or to display old revisions
What happens:
When one of the loaded revision was created before the upgrade, it fails with an AssertionError in ZOPE/Connection.py:register on "assert obj._p_jar is self".
Indeed:
(Pdb) obj._p_jar.__class__
<class OFS.History.HystoryJar at 0xb65dabcc>
(Pdb) self.__class__
<class 'ZODB.Connection.Connection'>

This happens, as far as I understand, because of this:
> Zope2-2.12.15-py2.6-linux-i686.egg/Products/PythonScripts/PythonScript.py(224)__setstate__()
((Pdb)) getattr(self, 'Python_magic', None)
'm\xf2\r\n'
((Pdb)) Python_magic
'\xd1\xf2\r\n'

Which leads to...
229                 if body:
230                     self._body = body + '\n'

And assigning to self._body in turn causes object to be registered to
ZODB.Connection, in turn causing the assertion error.

** Affects: zope2
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
https://bugs.launchpad.net/bugs/735999

Title:
  Zope 2.12 PythonScript manage_change_history_page functionalities
  broken for old objects


More information about the zope2-tracker mailing list