[ZODB-Dev] [ zodb-Bugs-555575 ] BTree.keys() failure

noreply@sourceforge.net noreply@sourceforge.net
Mon, 13 May 2002 11:48:25 -0700


Bugs item #555575, was opened at 2002-05-13 14:48
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=115628&aid=555575&group_id=15628

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Nobody/Anonymous (nobody)
Summary: BTree.keys() failure

Initial Comment:
Here's a "sharp" test case that fails on my box 
(Windows, Python 2.1, Zope TextIndexDS9-branch).  
Guido reported failure on Linux too:

. b = IOBTree()
. for i in xrange(29972): # works if 29971
.     b[i] = i
. for i in xrange(30): # works if 29
.     del b[i]
.     b[i+40000] = i
. print 'len(b)', len(b)
. print 'len(b.keys())', len(b.keys())
. print 'b.keys()[0]', b.keys()[0] # IndexError

That does not fail using an IIBTree, but this does:

. b = IIBTree()
. for i in xrange(29972*2):
.     b[i] = i
. for i in xrange(30*2):
.     del b[i]
.     b[i+40000*2] = i
. print 'len(b)', len(b)
. print 'len(b.keys())', len(b.keys())
. print 'b.keys()[0]', b.keys()[0] # IndexError

It's the same thing, except the trip counts have 
doubled.  I assume, but don't know, that this is 
related to that DEFAULT_MAX_BUCKET_SIZE is twice as 
large in _IIBTree.c than in _IOBTree.c.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=115628&aid=555575&group_id=15628