You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Section type isn't hashable despite defining a __hash__ method
Or more correctly, because of that method it is not hashable. The method raises an error.
File ".../elftools/elf/sections.py", line 126, in __hash__
return hash(self.header)
^^^^^^^^^^^^^^^^^
TypeError: unhashable type: 'Container'
Reproduce
pip install pyelftools==0.30
get an elf file. For example echo | as to produce a a.out elf (assuming elf unix-y system)
Using pyelftools 0.30
The Section type isn't hashable despite defining a
__hash__
methodOr more correctly, because of that method it is not hashable. The method raises an error.
Reproduce
pip install pyelftools==0.30
echo | as
to produce aa.out
elf (assuming elf unix-y system)Suggested fix
Just remove
Section.__hash__
and use default "id()"-based hashing.For example
Symbol
also doesn't have a__hash__
(but neither a__eq__
which Section does define)The text was updated successfully, but these errors were encountered: