[issue39846] Register .whl as a unpack format in shutil unpack

John Andersen report at bugs.python.org
Mon Oct 25 19:43:48 EDT 2021


John Andersen <johnandersenpdx at gmail.com> added the comment:

I ran into this today. Using a wrapper function around _make_zipfile due to https://github.com/python/cpython/blob/d5650a1738fe34f6e1db4af5f4c4edb7cae90a36/Lib/shutil.py#L817-L819 where there is a check for if the format is zip then don't pass owner and group.

```
def make_whlfile(*args, owner=None, group=None, **kwargs):
    return shutil._make_zipfile(*args, **kwargs)


shutil.register_archive_format("whl", make_whlfile, description="Wheel file")
shutil.register_unpack_format(
    "whl", [".whl"], shutil._unpack_zipfile, description="Wheel file"
)
```

----------
nosy: +pdxjohnny

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39846>
_______________________________________


More information about the Python-bugs-list mailing list