This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: 'python -mzipfile -c' does not zip empty directories
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: python -mzipfile fails to add empty folders to created zip
View: 22219
Assigned To: Nosy List: ryantimwilson, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2014-08-19 17:37 by ryantimwilson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
add_empty_dirs_to_zipfile.patch ryantimwilson, 2014-08-19 17:37 review
Messages (2)
msg225535 - (view) Author: Ryan Wilson (ryantimwilson) * Date: 2014-08-19 17:37
Running command:

$ mkdir foo; python -mzipfile -c foo; python -mzipfile -e dest
ls: cannot access dest: No such file or directory

This is because '' is empty since running 'python -mzipfile -c foo' does not zip empty directories.

Running 'unzip' also produces:
warning []:  zipfile is empty

The following posted patch fixes this issue.
msg225536 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-08-19 17:40
This is a duplicate of issue22219.
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66426
2014-08-19 17:40:45serhiy.storchakasetstatus: open -> closed

superseder: python -mzipfile fails to add empty folders to created zip

nosy: + serhiy.storchaka
messages: + msg225536
resolution: duplicate
stage: resolved
2014-08-19 17:37:14ryantimwilsoncreate