Initially, I was looking at bpo-18262 and saw the following Stack Overflow thread that was linked.
https://stackoverflow.com/questions/434641/how-do-i-set-permissions-attributes-on-a-file-in-a-zip-file-using-pythons-zip/6297838
I've attached a patch that gives ZipInfo objects a `ZipInfo.mode` property getter and setter to get and set the file mode.
I considered adding ZipFile.chmod but I didn't know how it would work given that archives can contain duplicate files.
As an aside, I wondered if there's a way to update file attributes inside zip archives without deleting and rewriting them and if not, whether it would be worthwhile to add one. |