Repository navigation
Conversation
zipfile: restore Unix permissions after extraction zipfile: restore Unix permissions after extraction
|
As this pr is linked to quite old issue, i'm really excited and looking forward to fix. waiting for members to review and give suggestion for this if we need improvements. Thanks! |
|
@vstinner gentle ping, please have a look in this when you get chance . Thanks! |
|
what's the status of this? |
* Restore Unix executable bits when extracting zip archives - SafeZipExtractor._extract_member now chmods each extracted file with the Unix mode stored in ZipInfo.external_attr (POSIX only, no-op when the archive carries no Unix attributes, e.g. Windows-authored zips). - stdlib zipfile never restores permission bits itself; a fix is tracked upstream at python/cpython#150061. - Fixes archives with more than one executable losing their exec bit after extraction, e.g. the bundled JBR inside the Kotlin Language Server distribution (jbr/bin/java and native libs), which previously only had its single top-level launcher script chmod'd by the language-server code. Fixes #2100 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
this needs review |
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
sorry, didn't mean to create noise ( i merged main to resolve conflict :( |
|
@ambv thanks! for the review, I've updated with changes, but i want to go through these once again, so marking in draft for now... also i'll update with news entry |
Documentation build overview
|
|
Another approach gh-154704 that prevents several issues and provides more flexibility. |
fixes #149839
zip file, stored Unix permissions were ignored and files always got default permissions instead.os.chmodafter extraction.zipfile.extractallnever restores stored Unix permissions #149839