eliben / pyelftools

Parsing ELF and DWARF in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v0.30 breaks Python 2

RadxaYuntian opened this issue · comments

Python 2 should be dead, but our supplier thinks differently, so here we are.

There are already some compatibility codes. However, there is another such case missed: https://github.com/eliben/pyelftools/blob/master/elftools/dwarf/namelut.py#L12

This caused our build to break:

Traceback (most recent call last):
  File "./arch/arm/mach-rockchip/make_fit_atf.py", line 15, in <module>
    from elftools.elf.elffile import ELFFile
  File "/usr/local/lib/python2.7/dist-packages/elftools/elf/elffile.py", line 41, in <module>
    from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
  File "/usr/local/lib/python2.7/dist-packages/elftools/dwarf/dwarfinfo.py", line 25, in <module>
    from .namelut import NameLUT
  File "/usr/local/lib/python2.7/dist-packages/elftools/dwarf/namelut.py", line 12, in <module>
    from collections.abc import Mapping
ImportError: No module named abc

Right now we have to to pin to v0.29 to make our build work again.

That's correct. Python 2 support was officially dropped starting with 0.30, see #415 (comment)

This was not mentioned in the v0.30 tagged commit or the README, so some official announcement might be beneficial.

I will mention it in the CHANGES file.

Note also that the README says only Python 3 is supported (changed in b398f40)

That's correct. Python 2 support was officially dropped starting with 0.30, see #415 (comment)

Then why is there a Python 2 wheel for 0.30? It's the one that pip installs by default:

Collecting pyelftools
  Downloading https://files.pythonhosted.org/packages/33/f9/281a411a5281b674b10830a2f312c64464b49916d097b8919f009de579e0/pyelftools-0.30-py2.py3-none-any.whl (177kB)
    100% |################################| 184kB 890kB/s
Installing collected packages: pyelftools
Successfully installed pyelftools-0.30

The only wheel spec I have in setup.cfg says universal = 1

I can remove it so future versions don't try to install on Python 2