diff -r 139c18943d9b Lib/shutil.py --- a/Lib/shutil.py Sat Nov 14 08:54:30 2015 +0000 +++ b/Lib/shutil.py Sat Nov 14 18:43:35 2015 +0800 @@ -677,8 +677,7 @@ zip_filename, base_dir) if not dry_run: - with zipfile.ZipFile(zip_filename, "w", - compression=zipfile.ZIP_DEFLATED) as zf: + with zipfile.ZipFile(zip_filename, "w") as zf: path = os.path.normpath(base_dir) zf.write(path, path) if logger is not None: @@ -692,7 +691,7 @@ for name in filenames: path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): - zf.write(path, path) + zf.write(path, path, zipfile.ZIP_DEFLATED) if logger is not None: logger.info("adding '%s'", path) diff -r 139c18943d9b Lib/zipfile.py --- a/Lib/zipfile.py Sat Nov 14 08:54:30 2015 +0000 +++ b/Lib/zipfile.py Sat Nov 14 18:43:35 2015 +0800 @@ -1444,7 +1444,9 @@ arcname += '/' zinfo = ZipInfo(arcname, date_time) zinfo.external_attr = (st[0] & 0xFFFF) << 16 # Unix attributes - if compress_type is None: + if isdir: + zinfo.compress_type = ZIP_STORED + elif compress_type is None: zinfo.compress_type = self.compression else: zinfo.compress_type = compress_type