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

zipfile ignores deflate level settings in zipinfo object #64093

Open
rmilne mannequin opened this issue Dec 5, 2013 · 4 comments
Open

zipfile ignores deflate level settings in zipinfo object #64093

rmilne mannequin opened this issue Dec 5, 2013 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@rmilne
Copy link
Mannequin

rmilne mannequin commented Dec 5, 2013

BPO 19894
Nosy @serhiy-storchaka, @bbayles
Files
  • zipfileinfo.diff: Docs, tests and module patch against current tip of 2.7 branch (ae9fb85ab4e0 ?)
  • 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 = None
    created_at = <Date 2013-12-05.09:26:49.418>
    labels = ['type-feature', 'library']
    title = 'zipfile ignores deflate level settings in zipinfo object'
    updated_at = <Date 2018-02-25.23:28:20.276>
    user = 'https://bugs.python.org/rmilne'

    bugs.python.org fields:

    activity = <Date 2018-02-25.23:28:20.276>
    actor = 'bbayles'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2013-12-05.09:26:49.418>
    creator = 'rmilne'
    dependencies = []
    files = ['32984']
    hgrepos = []
    issue_num = 19894
    keywords = ['patch']
    message_count = 4.0
    messages = ['205284', '206414', '245747', '312869']
    nosy_count = 6.0
    nosy_names = ['alanmcintyre', 'docs@python', 'jens', 'serhiy.storchaka', 'rmilne', 'bbayles']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue19894'
    versions = ['Python 3.5']

    @rmilne
    Copy link
    Mannequin Author

    rmilne mannequin commented Dec 5, 2013

    Reading the pkzip APPNOTE and the documentation for the zipfile module, I was under the impression that I could set the DEFLATE compression level, on a per-file basis, for each file added to an archive, by setting the appropriate bits in zipinfo.flag_bits.

    You can't. Hence the attached patch, which updates the docs, tests and module source to enables this ability and makes the user aware of it.

    @rmilne rmilne mannequin assigned docspython Dec 5, 2013
    @rmilne rmilne mannequin added type-bug An unexpected behavior, bug, or error docs Documentation in the Doc dir tests Tests in the Lib/test dir stdlib Python modules in the Lib dir labels Dec 5, 2013
    @serhiy-storchaka
    Copy link
    Member

    This is new feature and can be added only in 3.5.

    @serhiy-storchaka serhiy-storchaka removed docs Documentation in the Doc dir tests Tests in the Lib/test dir labels Dec 17, 2013
    @serhiy-storchaka serhiy-storchaka added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Dec 17, 2013
    @jens
    Copy link
    Mannequin

    jens mannequin commented Jun 24, 2015

    IMHO it should be possible to set compression level not only for DEFLATE.
    And it should be similar with the tarfile API.

    Seems that http://bugs.python.org/issue21417 will cover this.

    @bbayles
    Copy link
    Mannequin

    bbayles mannequin commented Feb 25, 2018

    This was fixed in bpo-21417, in Github PR 5385:

    #5385

    @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
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    Status: No status
    Development

    No branches or pull requests

    1 participant