MrMino / wheelfile

🔪🧀 API for creating and inspecting Python .whl files (wheels)
MIT License
29 stars 5 forks source link

Permissions of files are not preserved #17

Closed mboisson closed 3 months ago

mboisson commented 2 years ago

I am currently investigating this issue with our script that uses wheelfile: https://github.com/ComputeCanada/wheels_builder/issues/42

The permissions are not preserved when updating wheels. It could be related to this issue: https://bugs.python.org/issue15795

This is in particular problematic for executable scripts, because they lose the executable bit.

mboisson commented 2 years ago

ok, the issue happens only with files in the distinfo and data directories. That is because this code https://github.com/MrMino/wheelfile/blob/aa33ab1d5fd2c7b52f6ed1f7fdd675317a84de47/wheelfile.py#L1440

ends up creating a new ZipInfo through writestr: https://github.com/python/cpython/blob/main/Lib/zipfile.py#L1800

None of the extra data is preserved with that method.

MrMino commented 3 months ago

Fixed in 7b69c5aa14152abb2785b5a9e9fe56244c000168