Can't delete ZPT's
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Fix Released
|
Medium
|
Tres Seaver |
Bug Description
I created some ZPT's with Zope 2.9.x. These ZPT's have an empty string as content. The templates are added with:
manage_
Now with zope 2.11.x if I try to delete the ZPT an automatic unicode transformation starts.
This action fails, with the following message:
2008-03-04 07:13:00 INFO ZEO.ClientStorage (13387) Verifying cache
2008-03-04 07:13:00 INFO ZEO.ClientStorage (13387) endVerify finishing
2008-03-04 07:13:00 INFO ZEO.ClientStorage (13387) endVerify finished
2008-03-04 07:13:03 ERROR ZODB.Connection Couldn't load state for 0x06f649
Traceback (most recent call last):
File "/opt/211b1/
self.
File "/opt/211b1/
self.
File "/opt/211b1/
obj.
File "/opt/211b1/
if not isinstance(
KeyError: '_text'
My workaround is add a test in /lib/python/
def __setstate__(self, state):
# Perform on-the-fly migration to unicode.
# Perhaps it might be better to work with the 'generation' module
# here?
if state.has_
if not isinstance(
With new created ZPT's there is no problem.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Peter Koppatz wrote: addProduct[ 'PageTemplates' ].manage_ addPageTemplate (id=userid, text="" ) lib/python/ ZODB/Connection .py", line 804, in setstate lib/python/ ZODB/Connection .py", line 863, in _setstate setGhostState( obj, p) lib/python/ ZODB/serialize. py", line 605, in setGhostState _(state) lib/python/ Products/ PageTemplates/ ZopePageTemplat e.py", line 420, in __setstate__ state[' _text'] , unicode): Products/ PageTemplates/ ZopePageTemplat e.py : key('_text' ): state[' _text'] , unicode): e(state[ '_text' ], 'content_ type', 'text/html'), encodings) output_ encoding' ] = encoding dict__. update( state)
> Public bug reported:
>
> I created some ZPT's with Zope 2.9.x. These ZPT's have an empty string
> as content. The templates are added with:
>
> manage_
>
> Now with zope 2.11.x if I try to delete the ZPT an automatic unicode transformation starts.
> This action fails, with the following message:
>
> 2008-03-04 07:13:00 INFO ZEO.ClientStorage (13387) Verifying cache
> 2008-03-04 07:13:00 INFO ZEO.ClientStorage (13387) endVerify finishing
> 2008-03-04 07:13:00 INFO ZEO.ClientStorage (13387) endVerify finished
> 2008-03-04 07:13:03 ERROR ZODB.Connection Couldn't load state for 0x06f649
> Traceback (most recent call last):
> File "/opt/211b1/
> self._setstate(obj)
> File "/opt/211b1/
> self._reader.
> File "/opt/211b1/
> obj.__setstate_
> File "/opt/211b1/
> if not isinstance(
> KeyError: '_text'
>
> My workaround is add a test in
> /lib/python/
>
> def __setstate__(self, state):
> # Perform on-the-fly migration to unicode.
> # Perhaps it might be better to work with the 'generation' module
> # here?
> if state.has_
> if not isinstance(
> text, encoding = convertToUnicod
> state.get(
> preferred_
> state['_text'] = text
> state['
> self.__
>
> With new created ZPT's there is no problem.
>
> ** Affects: zope2
> Importance: Undecided
> Status: New
>
I can confirm the bug, with a unit test (see attached patch).
Tres. ======= ======= ======= ======= ======= ======= ======= ======= ==== palladion. com enigmail. mozdev. org
- --
=======
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFHzY1Z+ gerLs4ltQ4RAukH AJ9HN44SVZUxm/ ozXHDDgti3H24Au gCbBKK5 fE81Ex2hP9grc=
AUSpovVQH/
=yiFm
-----END PGP SIGNATURE-----