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: does not include optional descriptor signature #78653

Closed
silas mannequin opened this issue Aug 23, 2018 · 6 comments
Closed

zipfile: does not include optional descriptor signature #78653

silas mannequin opened this issue Aug 23, 2018 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@silas
Copy link
Mannequin

silas mannequin commented Aug 23, 2018

BPO 34472
Nosy @serhiy-storchaka, @silas
PRs
  • bpo-34472: Add data descriptor signature to zipfile #8871
  • [3.6] bpo-34472: Add data descriptor signature to zipfile (GH-8871) #9398
  • [3.7] bpo-34472: Add data descriptor signature to zipfile (GH-8871) #9399
  • [2.7] bpo-34472: Add data descriptor signature to zipfile (GH-8871) #9407
  • Files
  • zip_stream_example.py: Example code showing issue
  • 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 2018-09-22.18:03:34.606>
    created_at = <Date 2018-08-23.12:57:59.166>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'zipfile: does not include optional descriptor signature'
    updated_at = <Date 2018-09-22.18:03:48.081>
    user = 'https://github.com/silas'

    bugs.python.org fields:

    activity = <Date 2018-09-22.18:03:48.081>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-09-22.18:03:34.606>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2018-08-23.12:57:59.166>
    creator = 'silas'
    dependencies = []
    files = ['47760']
    hgrepos = []
    issue_num = 34472
    keywords = ['patch']
    message_count = 6.0
    messages = ['323943', '325664', '325667', '326101', '326104', '326105']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'silas']
    pr_nums = ['8871', '9398', '9399', '9407']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue34472'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @silas
    Copy link
    Mannequin Author

    silas mannequin commented Aug 23, 2018

    When adding a fileobj that is not seekable to a zip using the zipfile module, the optional signature value 0x08074b50 is not included. This breaks certain zip implementations, including the builtin MacOS Archive Utility.

    See https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT sections 4.3.9.3 and 4.3.9.4

    @silas silas mannequin added 3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir labels Aug 23, 2018
    @serhiy-storchaka
    Copy link
    Member

    New changeset 4ba3b50 by Serhiy Storchaka (Silas Sewell) in branch 'master':
    bpo-34472: Add data descriptor signature to zipfile (GH-8871)
    4ba3b50

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your contribution Silas.

    Since popular ZIP file implementation like Info-ZIP and Java write this signature unconditionally, I think most unzipping software support it if they support reading ZIP files in streaming mode at all, at it is safe to backport this change to all maintained versions.

    @serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Sep 18, 2018
    @serhiy-storchaka
    Copy link
    Member

    New changeset 6ec2981 by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-34472: Add data descriptor signature to zipfile (GH-8871) (ПР-9407)
    6ec2981

    @serhiy-storchaka
    Copy link
    Member

    New changeset ed21919 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
    bpo-34472: Add data descriptor signature to zipfile (GH-8871) (GH-9398)
    ed21919

    @serhiy-storchaka
    Copy link
    Member

    New changeset 44989bc by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7':
    bpo-34472: Add data descriptor signature to zipfile (GH-8871) (GH-9399)
    44989bc

    @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 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant