Skip to content

FD leaks in aifc module #60689

Closed
Closed

Description

@serhiy-storchaka
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']

    Activity

    1. serhiy-storchaka commented on Nov 16, 2012

      @serhiy-storchaka
      MemberAuthor

      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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      performancePerformance or resource usage
      on Nov 16, 2012
    3. ezio-melotti commented on Nov 16, 2012

      @ezio-melotti
      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?

    4. serhiy-storchaka commented on Nov 16, 2012

      @serhiy-storchaka
      MemberAuthor

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

    5. serhiy-storchaka commented on Nov 16, 2012

      @serhiy-storchaka
      MemberAuthor

      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.

    6. serhiy-storchaka commented on Dec 27, 2012

      @serhiy-storchaka
      MemberAuthor

      If no one objects I will commit this next year.

    7. birkenfeld commented on Dec 28, 2012

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

    8. serhiy-storchaka commented on Dec 28, 2012

      @serhiy-storchaka
      MemberAuthor

      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.

    9. python-dev commented on Dec 29, 2012

      python-devmannequin
      Mannequin

      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

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

    Labels

    performancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions