summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-23 12:55:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-23 12:55:09 (GMT)
commit666de7772708047b63125126b0147931571254a4 (patch)
tree8ceb8d7dcc07c82d982072b5757e5405018ea980 /Lib/shutil.py
parent61c4c44b2a821740c78964398a3469ad10bd03ad (diff)
downloadcpython-666de7772708047b63125126b0147931571254a4.zip
cpython-666de7772708047b63125126b0147931571254a4.tar.gz
cpython-666de7772708047b63125126b0147931571254a4.tar.bz2
Issue #28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index dc9f2eb..6cf88d9 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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))