[Zope-dev] Bug? + another bug (ZPatterns 0.0.4a)

Phillip J. Eby pje@telecommunity.com
Mon, 19 Jun 2000 10:52:44 -0500


At 08:12 PM 6/19/00 +0800, mike wrote:
>
>Another bug I found (file Rack.py):
>
>    def createItem(self,key):
>        # Create a new object, identified by key
>        item = self.getItem(key)
>        # XXX What if all items potentially exist?
>        if item is not None:
>            raise KeyError,("'%s' already exists" % key)
>        item = self._RawItem(key)
>        a = self.loadAttrib
>        if not a:
>            slot = self._writeableSlot(key)
>            slot[SelfKey] = item
>            item._setSlot(slot)         # Not needed for non-ZODB
>storage
>        item._objectAdding()
>        self._registerCanonical(k,item) # XXX Should we cache
>non-creation?
>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - k was not defined (=key?)
>        

It's supposed to be a single-item tuple of the key (key,), so the fixed
line would read:

        self._registerCanonical((key,),item) # XXX Should we cache
non-creation?

I'll put out an alpha2 release today with this and other fixes.