The zipfile module has issues with S3 upload when the zipfile is large because it uses fp.tell() and gets wrong info because S3File chunks the underlying file. The easiest solution is using tarfile instead, and that should not be a problem since windows11, mac and linux all support tar.gz.
The switch is already done in c30d30287b0e87575473c94f39dc2c307c25d64c, but we need to:
Fix the broken tests. The tests are broken because:
We use tarfile instead of zipfile module.
The add_file() method has been changed to take a django.core.files.File object instead of a file like object (because we need to have access to the input file size).
Add a message when we download a file that tells users that the format is tar.gz, and that they will need https://www.7-zip.org/ (or similar) to extract the file on older windows versions. The message should just have a default, but the template should be easy to override see (not_for_deploy/docs/sysadmin/branding.rst)
The zipfile module has issues with S3 upload when the zipfile is large because it uses
fp.tell()
and gets wrong info because S3File chunks the underlying file. The easiest solution is using tarfile instead, and that should not be a problem since windows11, mac and linux all support tar.gz.The switch is already done in c30d30287b0e87575473c94f39dc2c307c25d64c, but we need to:
add_file()
method has been changed to take adjango.core.files.File
object instead of a file like object (because we need to have access to the input file size).tar.gz
, and that they will need https://www.7-zip.org/ (or similar) to extract the file on older windows versions. The message should just have a default, but the template should be easy to override see (not_for_deploy/docs/sysadmin/branding.rst
)