classification
Title: [zipfile.py]: Make zip directory attributes more friendly for MS-Windows
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: christian.heimes, hynek, python-dev, serhiy.storchaka, tarek, vmurashev
Priority: normal Keywords: patch

Created on 2014-03-13 16:44 by vmurashev, last changed 2014-09-23 20:30 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
zipfile.py.diff vmurashev, 2014-03-13 16:44 diff for zipfile.py
zipfile_dirattrs.patch serhiy.storchaka, 2014-08-18 09:46 review
Messages (5)
msg213416 - (view) Author: Vitaly Murashev (vmurashev) Date: 2014-03-13 16:44
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.
msg225486 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-08-18 09:46
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().
msg225804 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-08-24 08:46
Could shutil experts please comment this patch?
msg226401 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-05 06:24
If there are no objections I'll commit the patch soon.
msg227381 - (view) Author: Roundup Robot (python-dev) Date: 2014-09-23 19:45
New changeset c6b884483cd6 by Serhiy Storchaka in branch '2.7':
Issue #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 #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 #20912: Now directories added to ZIP file have correct Unix and MS-DOS
https://hg.python.org/cpython/rev/051105a95461
History
Date User Action Args
2014-09-23 20:30:03serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-09-23 19:45:17python-devsetnosy: + python-dev
messages: + msg227381
2014-09-05 06:24:23serhiy.storchakasetmessages: + msg226401
2014-08-24 08:46:36serhiy.storchakasetnosy: + christian.heimes, tarek, hynek
messages: + msg225804
2014-08-18 09:47:34serhiy.storchakasetassignee: serhiy.storchaka
2014-08-18 09:46:30serhiy.storchakasetfiles: + zipfile_dirattrs.patch

stage: test needed -> patch review
messages: + msg225486
versions: - Python 3.3
2014-03-13 18:49:13serhiy.storchakasetnosy: + serhiy.storchaka
stage: test needed

versions: + Python 2.7
2014-03-13 16:44:21vmurashevcreate