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

Deleting first item causes anydbm.first() to fail #42742

Closed
danbiz mannequin opened this issue Dec 31, 2005 · 6 comments
Closed

Deleting first item causes anydbm.first() to fail #42742

danbiz mannequin opened this issue Dec 31, 2005 · 6 comments
Labels
easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@danbiz
Copy link
Mannequin

danbiz mannequin commented Dec 31, 2005

BPO 1394135
Nosy @birkenfeld, @devdanzin
Files
  • dbmBug.py: Code snippet and sample output
  • 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 = None
    closed_at = <Date 2010-08-26.16:19:13.182>
    created_at = <Date 2005-12-31.04:24:52.000>
    labels = ['easy', 'type-bug', 'library']
    title = 'Deleting first item causes anydbm.first() to fail'
    updated_at = <Date 2010-08-26.16:19:13.180>
    user = 'https://bugs.python.org/danbiz'

    bugs.python.org fields:

    activity = <Date 2010-08-26.16:19:13.180>
    actor = 'BreamoreBoy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-08-26.16:19:13.182>
    closer = 'BreamoreBoy'
    components = ['Library (Lib)']
    creation = <Date 2005-12-31.04:24:52.000>
    creator = 'danbiz'
    dependencies = []
    files = ['1861']
    hgrepos = []
    issue_num = 1394135
    keywords = ['easy']
    message_count = 6.0
    messages = ['27188', '27189', '27190', '27191', '83894', '115000']
    nosy_count = 5.0
    nosy_names = ['anthonybaxter', 'georg.brandl', 'danbiz', 'ajaksu2', 'BreamoreBoy']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1394135'
    versions = ['Python 2.6']

    @danbiz
    Copy link
    Mannequin Author

    danbiz mannequin commented Dec 31, 2005

    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.

    @danbiz danbiz mannequin added stdlib Python modules in the Lib dir labels Dec 31, 2005
    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=1188172

    Confirmed here (Linux, various Pythons).

    @anthonybaxter
    Copy link
    Mannequin

    anthonybaxter mannequin commented Jan 11, 2006

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

    @danbiz
    Copy link
    Mannequin Author

    danbiz mannequin commented Jan 11, 2006

    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.

    @devdanzin
    Copy link
    Mannequin

    devdanzin mannequin commented Mar 20, 2009

    Cannot reproduce with dbhash on trunk (Linux).

    @devdanzin devdanzin mannequin added type-bug An unexpected behavior, bug, or error labels Mar 20, 2009
    @devdanzin devdanzin mannequin added easy labels Apr 22, 2009
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Aug 26, 2010

    No replky to msg83894.

    @BreamoreBoy BreamoreBoy mannequin closed this as completed Aug 26, 2010
    @BreamoreBoy BreamoreBoy mannequin closed this as completed Aug 26, 2010
    @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
    easy 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