wheel: Empty dirs change introduced is incompatible with distlib library
It looks like 0.33.2 change is incompatible with latest distlib package.
If I try to do distlib.wheel.install() it throws an error because folder ZipInfo object filename is not in the records:
https://bitbucket.org/pypa/distlib/src/3b0fd333c8fb15bc04e570a23ee4836caefb7951/distlib/wheel.py#lines-521
I don’t see any details about Folders in PEP (https://www.python.org/dev/peps/pep-0427/), so not clear if this is something that should be addressed by wheel or distlib package.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 33 (30 by maintainers)
Commits related to this issue
- Update PEP 427 to specify presence of directory entries. Ref pypa/packaging-problems#212 and pypa/wheel#294. — committed to python/peps by jaraco 5 years ago
- test: Fix check_wheel_content() to consider reverted change in wheel 0.33.4 See https://github.com/pypa/wheel/issues/294 — committed to scikit-build/scikit-build by jcfr 5 years ago
- test: Fix check_wheel_content() to consider reverted change in wheel 0.33.4 See https://github.com/pypa/wheel/issues/294 — committed to scikit-build/scikit-build by jcfr 5 years ago
- wheel 0.33.3 was removed from pypi. See https://github.com/pypa/wheel/issues/294 — committed to zopefoundation/Zope by pbauer 5 years ago
- wheel 0.33.3 was removed from pypi. See https://github.com/pypa/wheel/issues/294 (#621) — committed to zopefoundation/Zope by pbauer 5 years ago
Easy way to reproduce: https://files.pythonhosted.org/packages/ff/1d/faec767bcb7b21156f6225d77da8cbf48dcb1f8e12dbc65663649073433a/azure_mgmt_iothub-0.8.0-py2.py3-none-any.whl
But not when adding files individually, “by hand”. Honestly, though, the “why” of this isn’t important. The reality is that the wheel spec doesn’t require compatible wheels to include directory entries. It would be pretty simple to change the spec, at which point fixing the tools is non-controversial. Why waste energy debating what’s “right” when just proposing a spec change will likely go through with little or no problem?
I don’t think anybody is suggesting a format change for RECORD. But I’m beginning to think that maybe a PEP amendment is in order to address the issue of empty directories in a wheel, one way or another. In the meantime, how do you feel about my proposed fix? It would restore old behavior for 99.99% of projects.
I’m -1 on changing the format of the RECORD.