How do I set permissions (attributes) on a file in a ZIP file using Python’s zipfile module?
This seems to work (thanks Evan, putting it here so the line is in context): buffer = “path/filename.zip” # zip filename to write (or file-like object) name = “folder/data.txt” # name of file inside zip bytes = “blah blah blah” # contents of file inside zip zip = zipfile.ZipFile(buffer, “w”, zipfile.ZIP_DEFLATED) info = zipfile.ZipInfo(name) info.external_attr … Read more