classification
Title: shutil.make_archive doesn't archive empty directories
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: eric.araujo, eugenek, python-dev, r.david.murray, serhiy.storchaka, tarek
Priority: normal Keywords: patch

Created on 2015-09-02 00:56 by eugenek, last changed 2015-09-17 09:32 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
make_archive_zip_dirs.patch serhiy.storchaka, 2015-09-06 15:48 review
Messages (5)
msg249522 - (view) Author: Eugene Kolo (eugenek) Date: 2015-09-02 00:56
Zip file is sometimes known to only contain files and the paths to them, but it can also have have empty folders, they are zero length files with a flag set.

make_archive just ignores empty directories, I propose that there should either be a flag, or it should include empty directories by default.
msg249542 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-09-02 13:33
See also issue 22219.  I think we should fix this in shutil as well.
msg249997 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-09-06 15:48
Here is a patch. Should this be considered as a bug fix rather than new feature?
msg250021 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-09-06 21:00
I think it could be considered a bug fix, given that other archive programs, including zipfile itself, act in this way, and it is relatively unlikely that anyone is *depending* on make_archive not including empty directories (ie: that it would break their code if these directories were included).
msg250146 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-08 02:54
New changeset 705ec4145f06 by Serhiy Storchaka in branch '2.7':
Issue #24982: shutil.make_archive() with the "zip" format now adds entries
https://hg.python.org/cpython/rev/705ec4145f06

New changeset 19216f5f6ee0 by Serhiy Storchaka in branch '3.4':
Issue #24982: shutil.make_archive() with the "zip" format now adds entries
https://hg.python.org/cpython/rev/19216f5f6ee0

New changeset 142a5027ab3e by Serhiy Storchaka in branch '3.5':
Issue #24982: shutil.make_archive() with the "zip" format now adds entries
https://hg.python.org/cpython/rev/142a5027ab3e

New changeset 6907716e7ccb by Serhiy Storchaka in branch 'default':
Issue #24982: shutil.make_archive() with the "zip" format now adds entries
https://hg.python.org/cpython/rev/6907716e7ccb
History
Date User Action Args
2015-09-17 09:32:38serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2015-09-08 03:08:21serhiy.storchakasetstage: patch review -> commit review
2015-09-08 02:54:29python-devsetnosy: + python-dev
messages: + msg250146
2015-09-06 21:00:51r.david.murraysetmessages: + msg250021
2015-09-06 15:48:58serhiy.storchakasetfiles: + make_archive_zip_dirs.patch

nosy: + tarek, eric.araujo
messages: + msg249997

keywords: + patch
stage: needs patch -> patch review
2015-09-06 14:53:36serhiy.storchakasetassignee: serhiy.storchaka
2015-09-02 13:33:28r.david.murraysetversions: + Python 3.4, Python 3.5, Python 3.6
nosy: + r.david.murray, serhiy.storchaka

messages: + msg249542

stage: needs patch
2015-09-02 00:56:17eugenekcreate