diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-05 21:46:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-05 21:46:25 +0200 |
| commit | 15789c14939f1c441c95963419e1b3f941a2831d (patch) | |
| tree | d11762a0e7e4d28652b651d6c4152bb2837c4560 /archive_util.py | |
| parent | b841e0aececb0e28ff3fabe29bf22c4b86fae9d8 (diff) | |
| download | python-setuptools-git-15789c14939f1c441c95963419e1b3f941a2831d.tar.gz | |
bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)
Diffstat (limited to 'archive_util.py')
| -rw-r--r-- | archive_util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/archive_util.py b/archive_util.py index 78ae5757..b002dc3b 100644 --- a/archive_util.py +++ b/archive_util.py @@ -166,7 +166,15 @@ def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): zip = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_STORED) + if base_dir != os.curdir: + path = os.path.normpath(os.path.join(base_dir, '')) + zip.write(path, path) + log.info("adding '%s'", path) for dirpath, dirnames, filenames in os.walk(base_dir): + for name in dirnames: + path = os.path.normpath(os.path.join(dirpath, name, '')) + zip.write(path, path) + log.info("adding '%s'", path) for name in filenames: path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): |
