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
This commit is contained in:
parent
c4b9dfe542
commit
ccdea1c3b8
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue