Issue 2669: bsddb iterkeys sliently fails when database modified during iteration (original) (raw)

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] 0

The Python "dict" object raises a RuntimeError when modifying the dictionary during iteration, the database should do the same.