X Tutup
The Wayback Machine - https://web.archive.org/web/20240503025831/https://github.com/python/cpython/issues/87264
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

tarfile list() method does not show file type #87264

Closed
val-shkolnikov mannequin opened this issue Feb 2, 2021 · 5 comments
Closed

tarfile list() method does not show file type #87264

val-shkolnikov mannequin opened this issue Feb 2, 2021 · 5 comments
Assignees
Labels
3.12 bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@val-shkolnikov
Copy link
Mannequin

val-shkolnikov mannequin commented Feb 2, 2021

BPO 43098
Nosy @ethanfurman, @akulakov, @val-shkolnikov
Files
  • 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 = 'https://github.com/ethanfurman'
    closed_at = None
    created_at = <Date 2021-02-02.04:35:47.148>
    labels = ['3.8', 'type-bug', '3.7']
    title = 'tarfile list() method does not show file type'
    updated_at = <Date 2021-12-07.21:18:14.344>
    user = 'https://github.com/val-shkolnikov'

    bugs.python.org fields:

    activity = <Date 2021-12-07.21:18:14.344>
    actor = 'val.shkolnikov'
    assignee = 'ethan.furman'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2021-02-02.04:35:47.148>
    creator = 'val.shkolnikov'
    dependencies = []
    files = ['49786']
    hgrepos = []
    issue_num = 43098
    keywords = []
    message_count = 4.0
    messages = ['386129', '397039', '407643', '407971']
    nosy_count = 3.0
    nosy_names = ['ethan.furman', 'andrei.avk', 'val.shkolnikov']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43098'
    versions = ['Python 3.7', 'Python 3.8']

    Linked PRs

    @val-shkolnikov
    Copy link
    Mannequin Author

    val-shkolnikov mannequin commented Feb 2, 2021

    The list() method of TarFile tarfile object shows question mark in place of file type in verbose mode. For instance
    python3 -m tarfile -v -l my.tar
    ?rwxr-xr-x vals/users 0 2021-01-16 18:28:30 bin/
    ?rwxr-x--- vals/users 266 2021-01-16 18:28:30 bin/backmine.sh
    ?rwxr-xr-x vals/users 950 2018-01-02 10:39:18 bin/tm.sh
    ?rwxrwxrwx vals/users 0 2021-01-16 11:49:36 bin/source-highlight -> ../source-highlight/bin/source-highlight
    ?rwxr-xr-x vals/users 435 2011-03-27 15:38:06 bin/dd.sh

    This is because the call stat.filemode(tarinfo.mode) does not pass tarinfo.type to stat.filemode. The type needs to be properly encoded and added to the argument.

    My patch is attached. Verified under Linux, Cygwin and Windows.

    @val-shkolnikov val-shkolnikov mannequin added 3.7 (EOL) end of life 3.8 only security fixes type-bug An unexpected behavior, bug, or error labels Feb 2, 2021
    @akulakov
    Copy link
    Contributor

    akulakov commented Jul 6, 2021

    I've tested this patch on OS X with symbolic links, dirs, files and it works fine.

    @akulakov
    Copy link
    Contributor

    akulakov commented Dec 4, 2021

    Val: contributions are only now accepted in form of github PRs, not patches.

    @val-shkolnikov
    Copy link
    Mannequin Author

    val-shkolnikov mannequin commented Dec 7, 2021

    contributions are only now accepted in form of github PRs
    Done

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @terryjreedy terryjreedy added 3.12 bugs and security fixes and removed 3.8 only security fixes 3.7 (EOL) end of life labels Nov 28, 2022
    @val-shkolnikov
    Copy link
    Contributor

    Replaced by val-shkolnikov#1

    val-shkolnikov added a commit to val-shkolnikov/cpython that referenced this issue Dec 8, 2022
    pythongh-87264: tarfile list() method does not show file type.
    @iritkatriel iritkatriel added the stdlib Python modules in the Lib dir label Nov 23, 2023
    ethanfurman pushed a commit that referenced this issue Dec 19, 2023
    Co-authored-by: val-shkolnikov <val@nvsoft.net>
    ryan-duve pushed a commit to ryan-duve/cpython that referenced this issue Dec 26, 2023
    Co-authored-by: val-shkolnikov <val@nvsoft.net>
    aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
    Co-authored-by: val-shkolnikov <val@nvsoft.net>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.12 bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    Status: Done
    Development

    No branches or pull requests

    5 participants
    X Tutup