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.
Logged In: YES user_id=29957 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. :)
Logged In: YES user_id=534494 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.