[New-bugs-announce] [issue34738] Distutils: ZIP files don't include directory entries

Serhiy Storchaka report at bugs.python.org
Wed Sep 19 09:47:27 EDT 2018


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

ZIP files created by distutils don't include entries for directories. For example, if the directory structure is

    dist/
        file1.py
        sub/
            file2.py

the ZIP file will contain entries 'dist/file1.py' and 'dist/sub/file2.py', but not 'dist/' and 'dist/sub/'.

This only when use the zipfile module. If it is not available for some reasons, the zip command is used. In that case directory entries are created. The are created also in TAR files.

All other methods of packing a tree to a ZIP in the stdlib (shutil.make_archive(), zipfile CLI, zipapp, Tools/msi/make_zip.py) create directory entries too.

zipimport doesn't support implicit namespace packages if directory entries are not added (issue14905).

The proposed PR makes distutils adding directory entries in a ZIP file.

----------
components: Distutils
messages: 325761
nosy: dstufft, eric.araujo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Distutils: ZIP files don't include directory entries
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34738>
_______________________________________


More information about the New-bugs-announce mailing list