Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
The inconsistency is not just with the tarfile module, but with other method of creating ZIP archives. The unix unzip command creates directories if needed, but I am not sure about other third-party utilities. Since all know ZIP creators creates entries for directories, I would not be surprised if there are ZIP readers that doesn't work without explicit entries for directories. Zipimport is an example of this. Matthew mentioned other case. Empty directories currently are added to the TAR archive, but are omitted in the ZIP archive (unless you use an external zip tool). TAR archives are common on Unix, ZIP archives are common on Windows, and we can get different source distributions for Unix and Windows. You need to add a fake empty file to be sure that the directory will be added in the distribution. Some old DOS archives needed this trick, but the ZIP format supports empty directories. The downside of adding entries for directories is that this increases the size of the archive. But the difference is pretty small. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34738> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com