[Zope-dev] Zope 2.X BIG Session problems - blocker - our site dies - need help of experience Zope developer, please

alex at halogen-dg.com alex at halogen-dg.com
Sat Feb 28 04:51:27 EST 2004


Hi

As far I understand the error happends in this code

Question to Python developers:

As far I understand, index does contain b, and
data does not contain 'b'.

Simple question: why does the line:

  v = self._data[b].get(k, notfound)

throw KeyError at any case? get does have next argument, and if
key is not found, ti will return [], right? 

It seems I do not understand Python code at this place. Please advice. 

Alex



--------------------------------- [ code from Transience.py -------
def get(self, k, default=_marker):
    self.lock.acquire()
    try:
        DEBUG and TLOG('get: called with k=%s' % k)
        notfound = []
        current = self._getCurrentBucket()
        DEBUG and TLOG('get: current is %s' % current)
        if default is _marker: default=None
        index = self._getIndex()
        b = index.get(k, notfound)
        if b is notfound:
            # it's not here, this is a genuine miss
            DEBUG and TLOG('bucket was notfound for %s' %k)
            return default
        else:
            v = self._data[b].get(k, notfound)
            if v is notfound:
                DEBUG and TLOG(
                    'get: %s was not found in index bucket (%s)' % (k, b))
                return default
--------------------------------- [ end code from Transience.py ----


-------------- [error] ----------------
     * Module ZPublisher.HTTPRequest, line 1218, in __getattr__
     * Module ZPublisher.HTTPRequest, line 1178, in get
     * Module Products.Sessions.SessionDataManager, line 93, in 
getSessionData
     * Module Products.Sessions.SessionDataManager, line 180, in 
_getSessionDataObject
     * Module Products.Transience.Transience, line 176, in 
new_or_existing
     * Module Products.Transience.Transience, line 809, in get

KeyError: 1077572580 
-------------- [end of error] ---------




--
Alex V. Koval
http://www.halogen-dg.com/
http://www.zwarehouse.org/




More information about the Zope-Dev mailing list