Have any of you run into this type of error? I have been exporting Archetype content items from Plone 2.5 and recreating them with Dexterity on Plone 5.0.4. It happens with 'GMT-5' and 'GMT-6' when I attempt to view the folder containing these new items or when I try to view one of the new items. I had to jump through some hoops to convert DateTime values to datetime, but I thought that using DateTime's ISO8601() method would avoid some of the inconsistencies I found in the old values (some had time zones, some did not).
2017-05-21 16:13:34 ERROR ZODB.Connection Couldn't load state for 0x2c1eff
Traceback (most recent call last):
File "/Users/kim/PloneBuilds/Plone-5.0.4-unified-clean/buildout-cache/eggs/ZODB3-3.10.5-py2.7-macosx-10.11-x86_64.egg/ZODB/Connection.py", line 860, in setstate
self._setstate(obj)
File "/Users/kim/PloneBuilds/Plone-5.0.4-unified-clean/buildout-cache/eggs/ZODB3-3.10.5-py2.7-macosx-10.11-x86_64.egg/ZODB/Connection.py", line 914, in _setstate
self._reader.setGhostState(obj, p)
File "/Users/kim/PloneBuilds/Plone-5.0.4-unified-clean/buildout-cache/eggs/ZODB3-3.10.5-py2.7-macosx-10.11-x86_64.egg/ZODB/serialize.py", line 612, in setGhostState
state = self.getState(pickle)
File "/Users/kim/PloneBuilds/Plone-5.0.4-unified-clean/buildout-cache/eggs/ZODB3-3.10.5-py2.7-macosx-10.11-x86_64.egg/ZODB/serialize.py", line 605, in getState
return unpickler.load()
File "/Users/kim/PloneBuilds/Plone-5.0.4-unified-clean/buildout-cache/eggs/pytz-2015.7-py2.7.egg/pytz/__init__.py", line 286, in _p
return unpickler(*args)
File "/Users/kim/PloneBuilds/Plone-5.0.4-unified-clean/buildout-cache/eggs/pytz-2015.7-py2.7.egg/pytz/tzinfo.py", line 526, in unpickler
tz = pytz.timezone(zone)
File "/Users/kim/PloneBuilds/Plone-5.0.4-unified-clean/buildout-cache/eggs/pytz-2015.7-py2.7.egg/pytz/__init__.py", line 180, in timezone
raise UnknownTimeZoneError(zone)
UnknownTimeZoneError: (UnknownTimeZoneError('GMT-5',), <function _p at 0x10d1155f0>, ('GMT-5',))
For now I've been able to get around these errors by hacking buildout-cache/eggs/pytz-2015.7-py2.7.egg/pytz/tzinfo.py so that it catches the exception in unpickler() but it makes me uneasy to have to do so:
def unpickler(zone, utcoffset=None, dstoffset=None, tzname=None):
"""Factory function for unpickling pytz tzinfo instances.
This is shared for both StaticTzInfo and DstTzInfo instances, because
database changes could cause a zones implementation to switch between
these two base classes and we can't break pickles on a pytz version
upgrade.
"""
# Raises a KeyError if zone no longer exists, which should never happen
# and would be a bug.
try:
tz = pytz.timezone(zone)
except:
tz = pytz.timezone('America/Chicago')
logger.warn('replacing bad timezone %s with America/Chicago' % zone)