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.py]: Make zip directory attributes more friendly for MS-Windows #65111

Closed
vmurashev mannequin opened this issue Mar 13, 2014 · 5 comments
Closed

[zipfile.py]: Make zip directory attributes more friendly for MS-Windows #65111

vmurashev mannequin opened this issue Mar 13, 2014 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@vmurashev
Copy link
Mannequin

vmurashev mannequin commented Mar 13, 2014

BPO 20912
Nosy @tiran, @tarekziade, @hynek, @serhiy-storchaka, @vmurashev
Files
  • zipfile.py.diff: diff for zipfile.py
  • zipfile_dirattrs.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/serhiy-storchaka'
    closed_at = <Date 2014-09-23.20:30:03.522>
    created_at = <Date 2014-03-13.16:44:21.975>
    labels = ['type-bug', 'library']
    title = '[zipfile.py]: Make zip directory attributes more friendly for MS-Windows'
    updated_at = <Date 2014-09-23.20:30:03.521>
    user = 'https://github.com/vmurashev'

    bugs.python.org fields:

    activity = <Date 2014-09-23.20:30:03.521>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-09-23.20:30:03.522>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2014-03-13.16:44:21.975>
    creator = 'vmurashev'
    dependencies = []
    files = ['34399', '36403']
    hgrepos = []
    issue_num = 20912
    keywords = ['patch']
    message_count = 5.0
    messages = ['213416', '225486', '225804', '226401', '227381']
    nosy_count = 6.0
    nosy_names = ['christian.heimes', 'tarek', 'python-dev', 'hynek', 'serhiy.storchaka', 'vmurashev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue20912'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @vmurashev
    Copy link
    Mannequin Author

    vmurashev mannequin commented Mar 13, 2014

    When I use 'zip' command-line tool on my Ubuntu 10.04 to pack a directory in zip-archive, it internally assigns '0x41ed0010' attributes for it.

    0x41ed0010 = 0x41ed << 0xfff + 0x0010

    Where:
    0x41ed - unix attributes (40755)
    0x0010 - means # MS-DOS directory flag

    At the same time zipfile.py doesn't provide MS-DOS directory flag.
    It seems be a good idea to do it.
    Patch suggested over 3.3.3 code-base.

    @vmurashev vmurashev mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Mar 13, 2014
    @serhiy-storchaka
    Copy link
    Member

    Looks good. But writestr() should be updated too. Some users use it to add a directory to ZIP file. Here is a patch with tests. It also changes attributes of regular file added by writestr().

    @serhiy-storchaka serhiy-storchaka self-assigned this Aug 18, 2014
    @serhiy-storchaka
    Copy link
    Member

    Could shutil experts please comment this patch?

    @serhiy-storchaka
    Copy link
    Member

    If there are no objections I'll commit the patch soon.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 23, 2014

    New changeset c6b884483cd6 by Serhiy Storchaka in branch '2.7':
    Issue bpo-20912: Now directories added to ZIP file have correct Unix and MS-DOS
    https://hg.python.org/cpython/rev/c6b884483cd6

    New changeset b06e25a357de by Serhiy Storchaka in branch '3.4':
    Issue bpo-20912: Now directories added to ZIP file have correct Unix and MS-DOS
    https://hg.python.org/cpython/rev/b06e25a357de

    New changeset 051105a95461 by Serhiy Storchaka in branch 'default':
    Issue bpo-20912: Now directories added to ZIP file have correct Unix and MS-DOS
    https://hg.python.org/cpython/rev/051105a95461

    @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-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant