Skip to content
Advertisement

How to create zip64 archive using shutil.make_archive

Python code snippet which creates creates zip archive file from a folder.

shutil.make_archive(file_path, 'zip', folder_path)

I am getting this error :

Filesize would require ZIP64 extensions.

How to create ZIP64 archive file using shutil.make_archive?

Note: I cannot use zipfile.ZipFile function.

Advertisement

Answer

You must be using a Python version prior to 3.4 unfortunately after reading shutil source code on github github . it’s clearly using zipfile.ZipFile from zipfile this is a closed issue now see here python, so Starting from Python 3.4, ZIP64 extensions is availble by default . But Prior to Python 3.4, make_archive will not create a file with ZIP64 extensions. If you are using an older version of Python and want ZIP64, you can use the zipfile.ZipFile() directly which you already mentioned .

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement