Issue 1516078: dbhash len not reliable (original) (raw)

Issue1516078

Created on 2006-07-03 01:12 by chrismorvant, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg60936 - (view) Author: cmorvant (chrismorvant) Date: 2006-07-03 01:12
Python Version 2.4.3 OS Windows XP When I open a db file in read only mode('r') the 'len' method will only work once. After this it will return only 0. Using anydbm on my windows box defaults to dbhash(bsddb). This only occurs with dbhash(dumbdbm and dbm on Unix work fine). The output of the sample code is "2 0 dbhash".
msg60937 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-07-03 22:12
Logged In: YES user_id=11375 Can you please provide a small test script that demonstrates the problem? When I try opening a dbhash database and calling len(), it returns the correct results.
msg61564 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2008-01-23 07:35
Works for me in 2.5 and 2.4 isn't getting bug fixes anymore. >>> import dbhash >>> d = dbhash.open('x.db', 'w') >>> d['e'] = 'Eee' >>> d['f'] = 'Ffff' >>> len(d) 2 >>> len(d) 2 It was likely fixed by this: ------------------------------------------------------------------------ r46684 | gregory.p.smith 2006-06-05 16:59:37 -0700 (Mon, 05 Jun 2006) 5 line s - bsddb: the __len__ method of a DB object has been fixed to return correct results. It could previously incorrectly return 0 in some cases. Fixes SF bug 1493322 (pybsddb bug 1184012).
History
Date User Action Args
2022-04-11 14:56:18 admin set github: 43600
2008-01-23 07:35:54 gregory.p.smith set status: open -> closedresolution: fixedmessages: + nosy: + gregory.p.smith
2006-07-03 01:12:59 chrismorvant create