Title: Deleting first item causes anydbm.first() to fail
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 2.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, ajaksu2, anthonybaxter, danbiz, georg.brandl
Priority: normal Keywords: easy

Created on 2005-12-31 04:24 by danbiz, last changed 2010-08-26 16:19 by BreamoreBoy. This issue is now closed.

File name Uploaded Description Edit danbiz, 2005-12-31 04:24 Code snippet and sample output
Messages (6)
msg27188 - (view) Author: Dan Bisalputra (danbiz) Date: 2005-12-31 04:24
If the first item in a database is deleted, the first
call to anydbm.first() after the deletion causes a
DBNotFoundError exception to be raised.

The attached program causes the error on my system.  I
am currently working around the problem by calling
first() after each deletion, enclosed by a try block.

I am using Python 2.4.2 running under Windows ME.
msg27189 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-01-10 22:50
Logged In: YES 

Confirmed here (Linux, various Pythons).
msg27190 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2006-01-11 12:19
Logged In: YES 

Which backend is this using? anydbm is just a very very
simple wrapper around a bunch of different backends - I have
difficulty believing that they _all_ have the same problem. :)
msg27191 - (view) Author: Dan Bisalputra (danbiz) Date: 2006-01-11 17:51
Logged In: YES 

whichdb() tells me it is using dbhash.  By the way, my
workaround using the try/except block ended up deferring the
problem until later.  I eventually ended up closing and
reopening the database after each deletion.  Not a problem
for the simple application I was building; the database
worked great otherwise.
msg83894 - (view) Author: Daniel Diniz (ajaksu2) (Python triager) Date: 2009-03-20 23:53
Cannot reproduce with dbhash on trunk (Linux).
msg115000 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-26 16:19
No replky to msg83894.
Date User Action Args
2010-08-26 16:19:13BreamoreBoysetstatus: open -> closed

nosy: + BreamoreBoy
messages: + msg115000

resolution: out of date
2009-04-22 14:35:50ajaksu2setkeywords: + easy
2009-03-20 23:53:03ajaksu2setversions: + Python 2.6, - Python 2.4
nosy: + ajaksu2

messages: + msg83894

type: behavior
stage: test needed
2005-12-31 04:24:52danbizcreate