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
python -mzipfile fails to add empty folders to created zip #66415
Comments
Compare $ mkdir foo; zip -q foo{,}; unzip -l foo.zip
Archive: foo.zip
Length Date Time Name
--------- ---------- -----
--------- ------- and $ mkdir foo; python -mzipfile -c foo{.zip,}; unzip -l foo.zip
Archive: foo.zip
warning [foo.zip]: zipfile is empty A patch was posted by Ryan Wilson in related issue bpo-22201. |
Directory entry should be added not only when directory is empty. See also bpo-20912. |
I think zipfile should add an entry for directories as zip tool does. Here is a patch. In additional it fixes zipfile -c for some corner cases (when arguments end with /, . or .. component). |
If there are no objections I'll commit the patch soon. |
Hmm, looks as I forgot to attach a patch. |
New changeset 911da1072099 by Serhiy Storchaka in branch '2.7': New changeset 981d18930d6d by Serhiy Storchaka in branch '3.4': New changeset d61d2e5a0956 by Serhiy Storchaka in branch 'default': |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: