Skip to content

bsddb iterkeys sliently fails when database modified during iteration #46921

Closed

Description

@tebeka
mannequin
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']

Activity

  1. tebeka commented on Apr 22, 2008

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

  2. added
    stdlib
    type-bug
    on Apr 22, 2008
  3. gpshead commented on May 25, 2008

    @gpshead
    Member

    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.

  4. self-assigned this
    on May 25, 2008
  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

stdlibtype-bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions