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

Use with statement in dbm.dumb #65928

Closed
PCManticore mannequin opened this issue Jun 12, 2014 · 5 comments
Closed

Use with statement in dbm.dumb #65928

PCManticore mannequin opened this issue Jun 12, 2014 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@PCManticore
Copy link
Mannequin

PCManticore mannequin commented Jun 12, 2014

BPO 21729
Nosy @rhettinger, @PCManticore, @serhiy-storchaka
Files
  • dbm_with_open.patch
  • 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/serhiy-storchaka'
    closed_at = <Date 2014-06-25.17:49:51.729>
    created_at = <Date 2014-06-12.07:24:41.807>
    labels = ['type-feature', 'library']
    title = 'Use `with` statement in dbm.dumb'
    updated_at = <Date 2014-06-25.17:49:51.728>
    user = 'https://github.com/PCManticore'

    bugs.python.org fields:

    activity = <Date 2014-06-25.17:49:51.728>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-06-25.17:49:51.729>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2014-06-12.07:24:41.807>
    creator = 'Claudiu.Popa'
    dependencies = []
    files = ['35588']
    hgrepos = []
    issue_num = 21729
    keywords = ['patch']
    message_count = 5.0
    messages = ['220335', '220379', '221559', '221561', '221563']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'Claudiu.Popa', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21729'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @PCManticore
    Copy link
    Mannequin Author

    PCManticore mannequin commented Jun 12, 2014

    Hello.

    Here's a short patch for dbm.dumb, which uses in various places the with statement for opening and closing files. Thanks.

    @PCManticore PCManticore mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jun 12, 2014
    @serhiy-storchaka serhiy-storchaka self-assigned this Jun 12, 2014
    @rhettinger
    Copy link
    Contributor

    Serhiy, after reviewing this, consider backporting it.

    The original code doesn't have a try/finally around the close() call and that could be considered a bug.

    @serhiy-storchaka
    Copy link
    Member

    Ah, month ago I wrote large patch which use 'with' in various places in stdlib for opening and closing files. But then I dropped it because afraid that it can be considered as code churn.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 25, 2014

    New changeset fdbcb11e0323 by Serhiy Storchaka in branch '3.4':
    Issue bpo-21729: Used the "with" statement in the dbm.dumb module to ensure
    http://hg.python.org/cpython/rev/fdbcb11e0323

    New changeset e41b4e8c0c1d by Serhiy Storchaka in branch 'default':
    Issue bpo-21729: Used the "with" statement in the dbm.dumb module to ensure
    http://hg.python.org/cpython/rev/e41b4e8c0c1d

    New changeset 893e79196fb3 by Serhiy Storchaka in branch '2.7':
    Issue bpo-21729: Used the "with" statement in the dbm.dumb module to ensure
    http://hg.python.org/cpython/rev/893e79196fb3

    @serhiy-storchaka
    Copy link
    Member

    Thanks Claudiu.

    Committed with yet one "with".

    @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-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants