How to create zip64 archive using shutil.make_archive

邮差的信 提交于 2021-02-10 18:55:55

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!