问题
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.
回答1:
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 .
来源:https://stackoverflow.com/questions/55661395/how-to-create-zip64-archive-using-shutil-make-archive