mirror of
https://github.com/python/cpython.git
synced 2025-07-16 07:45:20 +00:00
Issue #28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
This commit is contained in:
commit
7fc92bb38a
3 changed files with 19 additions and 3 deletions
|
@ -680,9 +680,10 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
|
|||
with zipfile.ZipFile(zip_filename, "w",
|
||||
compression=zipfile.ZIP_DEFLATED) as zf:
|
||||
path = os.path.normpath(base_dir)
|
||||
zf.write(path, path)
|
||||
if logger is not None:
|
||||
logger.info("adding '%s'", path)
|
||||
if path != os.curdir:
|
||||
zf.write(path, path)
|
||||
if logger is not None:
|
||||
logger.info("adding '%s'", path)
|
||||
for dirpath, dirnames, filenames in os.walk(base_dir):
|
||||
for name in sorted(dirnames):
|
||||
path = os.path.normpath(os.path.join(dirpath, name))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue