Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace unzip usage with Python's zipfile #258

Closed
FFY00 opened this issue Aug 15, 2020 · 2 comments · Fixed by #324
Closed

Replace unzip usage with Python's zipfile #258

FFY00 opened this issue Aug 15, 2020 · 2 comments · Fixed by #324

Comments

@FFY00
Copy link
Member

FFY00 commented Aug 15, 2020

Would it be possible to replace the unzip usage with Python's zipfile? I see no reason to have an external dependency such as this.

subprocess.check_output(['unzip', '-o', '-d', out_dir, zip_fname])

@lkollar
Copy link
Contributor

lkollar commented Aug 15, 2020

According to the comment above, unzip is used to work around an issue where permissions are not correctly preserved. If we can ensure the behaviour is preserved, we can replace it with ZipFile, but it won't be a trivial change probably.

Alternatively, once pypa/wheel#357 is landed and wheel will have a public API, we might be able to use that and drop the code dealing with ZIP files.

@FFY00
Copy link
Member Author

FFY00 commented Aug 15, 2020

Sure, although you can still access the permissions in zipfile.ZipInfo IIRC. You can use infolist to set the permissions after the extraction, should be a pretty straight forward patch.

The reason I am asking this is because unzip is a custom external program. It is not part of any operating system. Some Linux distributions might include it by default, but definitely not all, it might also be missing.

mayeut added a commit to mayeut/auditwheel that referenced this issue Aug 22, 2021
This removes the need to have `unzip` installed.

fixes pypa#258
closes pypa#312
mayeut added a commit to mayeut/auditwheel that referenced this issue Aug 24, 2021
This removes the need to have `unzip` installed.

fixes pypa#258
closes pypa#312
auvipy pushed a commit that referenced this issue Aug 28, 2021
This removes the need to have `unzip` installed.

fixes #258
closes #312
@mayeut mayeut mentioned this issue Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants