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

Fix fd leak in sunau #54474

Closed
bbrazil mannequin opened this issue Oct 31, 2010 · 6 comments
Closed

Fix fd leak in sunau #54474

bbrazil mannequin opened this issue Oct 31, 2010 · 6 comments
Labels
performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@bbrazil
Copy link
Mannequin

bbrazil mannequin commented Oct 31, 2010

BPO 10265
Nosy @pitrou, @briancurtin
Files
  • sunau_fd_leak.patch
  • sunau_fd_leak_v2.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 = None
    closed_at = <Date 2010-10-31.21:27:21.510>
    created_at = <Date 2010-10-31.15:03:31.796>
    labels = ['library', 'performance']
    title = 'Fix fd leak in sunau'
    updated_at = <Date 2010-10-31.21:27:21.508>
    user = 'https://bugs.python.org/bbrazil'

    bugs.python.org fields:

    activity = <Date 2010-10-31.21:27:21.508>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-10-31.21:27:21.510>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2010-10-31.15:03:31.796>
    creator = 'bbrazil'
    dependencies = []
    files = ['19446', '19447']
    hgrepos = []
    issue_num = 10265
    keywords = ['patch']
    message_count = 6.0
    messages = ['120049', '120051', '120056', '120061', '120066', '120087']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'brian.curtin', 'bbrazil']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue10265'
    versions = ['Python 3.2']

    @bbrazil
    Copy link
    Mannequin Author

    bbrazil mannequin commented Oct 31, 2010

    Please see attached.

    It's possible that this change will lead to fds leaking if someone is passing in a fd, however a) this is consistent with how other modules (e.g. uu) do it and b) of the 2 (!) uses of this module I found on Google Codesearch, both pass in filenames.

    @bbrazil bbrazil mannequin added the stdlib Python modules in the Lib dir label Oct 31, 2010
    @briancurtin
    Copy link
    Member

    Forget the attachment?

    @briancurtin briancurtin added the performance Performance or resource usage label Oct 31, 2010
    @bbrazil
    Copy link
    Mannequin Author

    bbrazil mannequin commented Oct 31, 2010

    That'd help alright.

    @pitrou
    Copy link
    Member

    pitrou commented Oct 31, 2010

    It's possible that this change will lead to fds leaking if someone is
    passing in a fd

    I don't think so, why do you say that?

    That said, there's an indentation problem in your patch.

    @bbrazil
    Copy link
    Mannequin Author

    bbrazil mannequin commented Oct 31, 2010

    Currently, if you pass in a fd it'll be closed by the __del__. My patch no longer does this so any use of the module depending on this behaviour could leak an fd. However, noone seems to use the module that way.

    V2 attached.

    @pitrou
    Copy link
    Member

    pitrou commented Oct 31, 2010

    Committed in r86067. Thank you Brian!

    @pitrou pitrou closed this as completed Oct 31, 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
    performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants