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

FD leaks in aifc module #60689

Closed
serhiy-storchaka opened this issue Nov 16, 2012 · 8 comments
Closed

FD leaks in aifc module #60689

serhiy-storchaka opened this issue Nov 16, 2012 · 8 comments
Assignees
Labels
performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@serhiy-storchaka
Copy link
Member

BPO 16485
Nosy @birkenfeld, @jcea, @ezio-melotti, @bitdancer, @serhiy-storchaka
Files
  • aifc_close.patch: Patch for 3.x
  • aifc_close-2.7.patch: Patch for 2.7
  • 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 2012-12-29.20:57:42.135>
    created_at = <Date 2012-11-16.12:49:33.493>
    labels = ['library', 'performance']
    title = 'FD leaks in aifc module'
    updated_at = <Date 2013-01-27.02:05:17.735>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2013-01-27.02:05:17.735>
    actor = 'jcea'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2012-12-29.20:57:42.135>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2012-11-16.12:49:33.493>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['27999', '28000']
    hgrepos = []
    issue_num = 16485
    keywords = ['patch']
    message_count = 8.0
    messages = ['175683', '175685', '175686', '175688', '178325', '178366', '178388', '178533']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'jcea', 'ezio.melotti', 'r.david.murray', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue16485'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3', 'Python 3.4']

    @serhiy-storchaka
    Copy link
    Member Author

    Aifc_write.close() can raise exception and left the internal file object not closed. The patch closes the file object even in case of error and reset _file to None even in case of the file object close() raises an exception, so that Aifc_write.close() can be called repeatedly.

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir performance Performance or resource usage labels Nov 16, 2012
    @ezio-melotti
    Copy link
    Member

    Adding "with" support to Aifc_write looks like a new feature, but Aifc_write doesn't seem to be part of the public API. Does this change (indirectly) add "with" support to any part of the public API?

    @serhiy-storchaka
    Copy link
    Member Author

    Sorry, I miss that test_close() already exists. Merged.

    @serhiy-storchaka
    Copy link
    Member Author

    Adding "with" support to Aifc_write looks like a new feature, but Aifc_write doesn't seem to be part of the public API. Does this change (indirectly) add "with" support to any part of the public API?

    Don't pay attention, it was a wrong patch. For "with" support see bpo-16486.

    @serhiy-storchaka
    Copy link
    Member Author

    If no one objects I will commit this next year.

    @serhiy-storchaka serhiy-storchaka self-assigned this Dec 27, 2012
    @birkenfeld
    Copy link
    Member

    Looks good to me, except:
    the patch contains unrelated whitespace changes. Please don't commit them along the fix. If you think they are really necessary, they should go in a separate commit.

    @serhiy-storchaka
    Copy link
    Member Author

    Of course. Thanks for point. It's my editor made wrong whitespace changes after block indent/unindent. "hg diff" shows this changes and I shouldn't miss this. I will review every patch before commit one more time.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 29, 2012

    New changeset cf8d692cc847 by Serhiy Storchaka in branch '2.7':
    Issue bpo-16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
    http://hg.python.org/cpython/rev/cf8d692cc847

    New changeset e3c4e9f4ea0f by Serhiy Storchaka in branch '3.2':
    Issue bpo-16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
    http://hg.python.org/cpython/rev/e3c4e9f4ea0f

    New changeset 9a571c4a16d1 by Serhiy Storchaka in branch '3.3':
    Issue bpo-16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
    http://hg.python.org/cpython/rev/9a571c4a16d1

    New changeset 79a8f6e1dfb0 by Serhiy Storchaka in branch 'default':
    Issue bpo-16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
    http://hg.python.org/cpython/rev/79a8f6e1dfb0

    @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
    performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants