wheel icon indicating copy to clipboard operation
wheel copied to clipboard

WheelFile extract does not preserve permissions

Open gilfree opened this issue 1 year ago • 3 comments

In issue #514, the command line for wheel unpack was fixed to preserve executable bit for files.

https://github.com/pypa/wheel/blob/0a4f40ecf967757b43e2cdfd4b3c52b16d15614a/src/wheel/cli/unpack.py#L24

But this issue still exists when extracting files programmatically.

For example:

wheel = WheelFile(wheel_path)
wheel.extractall(temp_dir )

The issue is of course rooted in the same problem. As extractall and extract methods inherit from zipfile.

Maybe it will be better to override these methods for WheelFile and fix the permissions issue there, instead of in the unpack command?

Will you be open for a PR for such a change?

gilfree avatar Apr 02 '24 14:04 gilfree

There's the fundamental, underlying issue of the wheel standard not having explicit support for file permissions (as those are platform specific). I'm personally convinced that such support would be useful, but I think it needs to be added to the standard. I don't have the bandwidth available to drive such a change myself though.

agronholm avatar Apr 02 '24 18:04 agronholm

Will you be open to a PR that will apply the same fix as in unpack, to make the behavior the same?

gilfree avatar Apr 03 '24 05:04 gilfree

Will you be open to a PR that will apply the same fix as in unpack, to make the behavior the same?

Yeah, sure.

agronholm avatar Apr 03 '24 06:04 agronholm