This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: bsddb iterkeys sliently fails when database modified during iteration
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: gregory.p.smith, jcea, tebeka
Priority: normal Keywords:

Created on 2008-04-22 17:52 by tebeka, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg65676 - (view) Author: Miki Tebeka (tebeka) * Date: 2008-04-22 17:52
>>> db = bsddb.btopen("/tmp/n")
>>> for i in range(5):
	db[str(i)] = None
>>> db
{'1': '', '0': '', '3': '', '2': '', '4': ''}
>>> for k in db.iterkeys():
	print k
	del db[k]

The Python "dict" object raises a RuntimeError when modifying the
dictionary during iteration, the database should do the same.
msg67330 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2008-05-25 08:35
Fixed in trunk r63617.

Fix issue2669: bsddb simple/legacy interface iteration silently fails
when database changes size during iteration.

It now behaves like a dictionary, the next attempt to get a value from
the iterator after the database has changed size will raise a RuntimeError.
Date User Action Args
2022-04-11 14:56:33adminsetgithub: 46921
2008-05-25 08:35:59gregory.p.smithsetstatus: open -> closed
nosy: + gregory.p.smith
messages: + msg67330
priority: normal
assignee: gregory.p.smith
resolution: fixed
2008-04-26 02:35:21jceasetnosy: + jcea
2008-04-22 17:52:06tebekacreate