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 potential resource warnings in distutils #79597

Closed
BoboTiG mannequin opened this issue Dec 5, 2018 · 6 comments
Closed

Fix potential resource warnings in distutils #79597

BoboTiG mannequin opened this issue Dec 5, 2018 · 6 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@BoboTiG
Copy link
Mannequin

BoboTiG mannequin commented Dec 5, 2018

BPO 35416
Nosy @merwok, @methane, @serhiy-storchaka, @dstufft, @tirkarthi, @BoboTiG
PRs
  • bpo-35416: Fix potential resource warnings in distutils #10918
  • 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 2019-04-08.13:20:52.125>
    created_at = <Date 2018-12-05.08:54:19.655>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Fix potential resource warnings in distutils'
    updated_at = <Date 2019-04-08.13:20:52.124>
    user = 'https://github.com/BoboTiG'

    bugs.python.org fields:

    activity = <Date 2019-04-08.13:20:52.124>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-04-08.13:20:52.125>
    closer = 'methane'
    components = ['Distutils']
    creation = <Date 2018-12-05.08:54:19.655>
    creator = 'Tiger-222'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35416
    keywords = ['patch']
    message_count = 6.0
    messages = ['331097', '331107', '331110', '331114', '331118', '339635']
    nosy_count = 6.0
    nosy_names = ['eric.araujo', 'methane', 'serhiy.storchaka', 'dstufft', 'xtreak', 'Tiger-222']
    pr_nums = ['10918']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35416'
    versions = ['Python 3.8']

    @BoboTiG
    Copy link
    Mannequin Author

    BoboTiG mannequin commented Dec 5, 2018

    I am looking to clean-up potential ResourceWarnings in distutils. The patch will provide 2 changes:
    - ensure file descriptor are always closed when it is not the case
    - and uniformization of the "with open(...)" use

    @BoboTiG BoboTiG mannequin added 3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Dec 5, 2018
    @tirkarthi
    Copy link
    Member

    There is a similar open issue bpo-22831 with patches for distutils and Tools.

    @BoboTiG
    Copy link
    Mannequin Author

    BoboTiG mannequin commented Dec 5, 2018

    I saw it but it is quite old and targetting 3.5. I opended this issue to target only distutils, easier to eventually backport than a big patch on a lot of files.

    @merwok
    Copy link
    Member

    merwok commented Dec 5, 2018

    I think the places that already use try/finally: close are correct.

    We try to minimize churn in distutils; changing to with is nice but does not fix errors or warning in these cases.

    The changes for the few spots that don’t use finally: close are welcome though!

    @BoboTiG
    Copy link
    Mannequin Author

    BoboTiG mannequin commented Dec 5, 2018

    OK then I updated the PR to only update code that would really leak resources.

    @methane
    Copy link
    Member

    methane commented Apr 8, 2019

    New changeset 58721a9 by Inada Naoki (Mickaël Schoentgen) in branch 'master':
    bpo-35416: fix potential resource warnings in distutils (GH-10918)
    58721a9

    @methane methane closed this as completed Apr 8, 2019
    @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
    3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants