From ccdea1c3b86be198fc87eb81853900d49ee60b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Cor=C3=A9?= Date: Fri, 18 Aug 2017 20:55:40 +0200 Subject: [PATCH] archive: allow ZIP64 by default (#24200) allowZip64 is True by default since python 3.4, see https://docs.python.org/3/library/zipfile.html#zipfile-objects With python 2.7, when the file or folder to zip is >2G, zipfile raises LargeZipFile. This commit set allowZip64 to true. Fixes #24125 --- lib/ansible/modules/files/archive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/archive.py b/lib/ansible/modules/files/archive.py index 08d486ee9fe..6d9c28826fc 100644 --- a/lib/ansible/modules/files/archive.py +++ b/lib/ansible/modules/files/archive.py @@ -281,7 +281,7 @@ def main(): try: # Slightly more difficult (and less efficient!) compression using zipfile module if format == 'zip': - arcfile = zipfile.ZipFile(dest, 'w', zipfile.ZIP_DEFLATED) + arcfile = zipfile.ZipFile(dest, 'w', zipfile.ZIP_DEFLATED, True) # Easier compression using tarfile module elif format == 'gz' or format == 'bz2': @@ -390,7 +390,7 @@ def main(): try: if format == 'zip': - arcfile = zipfile.ZipFile(dest, 'w', zipfile.ZIP_DEFLATED) + arcfile = zipfile.ZipFile(dest, 'w', zipfile.ZIP_DEFLATED, True) arcfile.write(path, path[len(arcroot):]) arcfile.close() state = 'archive' # because all zip files are archives