Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsddb iterkeys sliently fails when database modified during iteration #46921

Closed
tebeka mannequin opened this issue Apr 22, 2008 · 2 comments
Closed

bsddb iterkeys sliently fails when database modified during iteration #46921

tebeka mannequin opened this issue Apr 22, 2008 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@tebeka
Copy link
Mannequin

tebeka mannequin commented Apr 22, 2008

BPO 2669
Nosy @gpshead, @jcea, @tebeka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/gpshead'
closed_at = <Date 2008-05-25.08:35:59.912>
created_at = <Date 2008-04-22.17:52:06.318>
labels = ['type-bug', 'library']
title = 'bsddb iterkeys sliently fails when database modified during iteration'
updated_at = <Date 2008-05-25.08:35:59.827>
user = 'https://github.com/tebeka'

bugs.python.org fields:

activity = <Date 2008-05-25.08:35:59.827>
actor = 'gregory.p.smith'
assignee = 'gregory.p.smith'
closed = True
closed_date = <Date 2008-05-25.08:35:59.912>
closer = 'gregory.p.smith'
components = ['Library (Lib)']
creation = <Date 2008-04-22.17:52:06.318>
creator = 'tebeka'
dependencies = []
files = []
hgrepos = []
issue_num = 2669
keywords = []
message_count = 2.0
messages = ['65676', '67330']
nosy_count = 3.0
nosy_names = ['gregory.p.smith', 'jcea', 'tebeka']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2669'
versions = ['Python 2.6']

@tebeka
Copy link
Mannequin Author

tebeka mannequin commented Apr 22, 2008

>>> 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.

@tebeka tebeka mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 22, 2008
@gpshead
Copy link
Member

gpshead commented May 25, 2008

Fixed in trunk r63617.

Fix bpo-2669: 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.

@gpshead gpshead closed this as completed May 25, 2008
@gpshead gpshead self-assigned this May 25, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant