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

Suggested Enhancements to zipfile & tarfile command line interfaces #75365

Closed
GadgetSteve mannequin opened this issue Aug 11, 2017 · 3 comments
Closed

Suggested Enhancements to zipfile & tarfile command line interfaces #75365

GadgetSteve mannequin opened this issue Aug 11, 2017 · 3 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@GadgetSteve
Copy link
Mannequin

GadgetSteve mannequin commented Aug 11, 2017

BPO 31182
Nosy @brettcannon, @serhiy-storchaka, @GadgetSteve
PRs
  • bpo-31182: enhancements to tarfile and zipfile's CLI #3084
  • 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-03-29.20:54:42.344>
    created_at = <Date 2017-08-11.08:25:56.339>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Suggested Enhancements to zipfile & tarfile command line interfaces'
    updated_at = <Date 2019-03-29.20:54:42.344>
    user = 'https://github.com/GadgetSteve'

    bugs.python.org fields:

    activity = <Date 2019-03-29.20:54:42.344>
    actor = 'brett.cannon'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-03-29.20:54:42.344>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2017-08-11.08:25:56.339>
    creator = 'Steve Barnes'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31182
    keywords = []
    message_count = 3.0
    messages = ['300156', '302328', '339148']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'serhiy.storchaka', 'Steve Barnes']
    pr_nums = ['3084']
    priority = 'normal'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue31182'
    versions = ['Python 3.7']

    @GadgetSteve
    Copy link
    Mannequin Author

    GadgetSteve mannequin commented Aug 11, 2017

    I would like to add to the command line of both tarfile and zipfile interface some additional options that I believe to be useful.

    1. Wildcard filename matching for archiving
    2. Recursive archiving (with excludes)
    3. Append to archive option
    4. Compression Selection
      4.1 For zipfile: zip64, bizp2 & lzma (if available)
      4.2 For tarfile: document that gz, xz & bz2 are there and determined by ext.

    @GadgetSteve GadgetSteve mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 11, 2017
    @serhiy-storchaka
    Copy link
    Member

    The command-line interface of zipfile and tarfile modules was deliberately kept simple. If you need more complex functionality, just write a script. Python is a programming language!

    1. Wildcard filename matching for archiving

    This is a work for a shell. Interpreting wildcards by a program breaks compatibility and makes impossible to handle files containing special characters. For example it breaks:

    python3 -m zipfile -c myzip.zip "The Book [vol. 5].txt".
    

    No way.

    1. Recursive archiving (with excludes)

    Archiving already is recursive. It may be worth to add an option for adding directories not recursively.

    1. Append to archive option

    May be. I don't know what to do with compressed tar archives.

    4.1 For zipfile: zip64, bizp2 & lzma (if available)

    Would be nice. And this option could force compression for tarfile.

    As new features they can be added only in 3.7.

    @brettcannon
    Copy link
    Member

    I'm going to agree w/ Serhiy and say thanks to Steve for the idea but for maintainability purposes we should keep the CLI of both modules simple and only for critical operations.

    @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.7 (EOL) end of life 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