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

Allow to pass fileobj to is_tarfile #73621

Closed
thomwiggers mannequin opened this issue Feb 3, 2017 · 5 comments
Closed

Allow to pass fileobj to is_tarfile #73621

thomwiggers mannequin opened this issue Feb 3, 2017 · 5 comments
Assignees
Labels
3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@thomwiggers
Copy link
Mannequin

thomwiggers mannequin commented Feb 3, 2017

BPO 29435
Nosy @ethanfurman, @thomwiggers, @tirkarthi, @woodruffw
PRs
  • bpo-29435: Allow is_tarfile to take a filelike obj #18090
  • 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/ethanfurman'
    closed_at = <Date 2020-01-23.02:26:01.082>
    created_at = <Date 2017-02-03.14:37:33.153>
    labels = ['type-feature', 'library', '3.9']
    title = 'Allow to pass fileobj to is_tarfile'
    updated_at = <Date 2020-01-23.02:50:14.325>
    user = 'https://github.com/thomwiggers'

    bugs.python.org fields:

    activity = <Date 2020-01-23.02:50:14.325>
    actor = 'yossarian'
    assignee = 'ethan.furman'
    closed = True
    closed_date = <Date 2020-01-23.02:26:01.082>
    closer = 'ethan.furman'
    components = ['Library (Lib)']
    creation = <Date 2017-02-03.14:37:33.153>
    creator = 'twiggers'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 29435
    keywords = ['patch']
    message_count = 5.0
    messages = ['286869', '360205', '360531', '360532', '360533']
    nosy_count = 4.0
    nosy_names = ['ethan.furman', 'twiggers', 'xtreak', 'yossarian']
    pr_nums = ['18090']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue29435'
    versions = ['Python 3.9']

    @thomwiggers
    Copy link
    Mannequin Author

    thomwiggers mannequin commented Feb 3, 2017

    The tarfile.is_tarfile() function only supports opening from paths. However, the Tarfile class also supports opening from fileobjs. It would be useful if the is_tarfile function would also accept those.

    For reference, this is the current implementation:

    def is_tarfile(name):

    @thomwiggers thomwiggers mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 3, 2017
    @woodruffw
    Copy link
    Mannequin

    woodruffw mannequin commented Jan 17, 2020

    I'll take a stab at this. It looks like Tarfile.open takes an optional keyword that should make this straightforward.

    @tirkarthi tirkarthi added the 3.9 only security fixes label Jan 19, 2020
    @ethanfurman
    Copy link
    Member

    New changeset dd754ca by Ethan Furman (William Woodruff) in branch 'master':
    bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)
    dd754ca

    @ethanfurman
    Copy link
    Member

    Thanks, William!

    @ethanfurman ethanfurman self-assigned this Jan 23, 2020
    @woodruffw
    Copy link
    Mannequin

    woodruffw mannequin commented Jan 23, 2020

    Thanks to you to!

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

    2 participants