From: Guido van Rossum Date: Sat, 14 Apr 2001 16:17:00 +0000 (+0000) Subject: Pete Shinners discovered that zipfile.ZipFile() is called with mode X-Git-Tag: v2.1c2~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b61914dd5baf5613bde1d9379cf24992c943ea1f;p=python Pete Shinners discovered that zipfile.ZipFile() is called with mode argument "wb", while the only valid modes are "r", "w" or "a". Fix this by changing the mode to "w". --- diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py index 61bc25ea0f..4c5641b951 100644 --- a/Lib/distutils/archive_util.py +++ b/Lib/distutils/archive_util.py @@ -100,7 +100,7 @@ def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): z.write(path, path) if not dry_run: - z = zipfile.ZipFile(zip_filename, "wb", + z = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_DEFLATED) os.path.walk(base_dir, visit, z)