typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Add pyelftools stubs

Open JonathonReinhart opened this issue 2 years ago • 1 comments

https://github.com/eliben/pyelftools/issues/371

JonathonReinhart avatar Jan 08 '24 07:01 JonathonReinhart

Diff from mypy_primer, showing the effect of this PR on open source code:

manticore (https://github.com/trailofbits/manticore)
+ manticore/platforms/linux.py:1461: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1498: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1532: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1563: error: "Struct" has no attribute "e_entry"  [attr-defined]
+ manticore/platforms/linux.py:1564: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1595: error: "Struct" has no attribute "e_entry"  [attr-defined]
+ manticore/platforms/linux.py:1613: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1647: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1682: error: "Struct" has no attribute "e_phoff"  [attr-defined]
+ manticore/platforms/linux.py:1683: error: "Struct" has no attribute "e_phentsize"  [attr-defined]
+ manticore/platforms/linux.py:1684: error: "Struct" has no attribute "e_phnum"  [attr-defined]
+ manticore/platforms/linux.py:1687: error: "Struct" has no attribute "e_flags"  [attr-defined]

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/commands/elf.py:3: note: In module imported here:
+ pwndbg/gdblib/elf.py: note: In function "get_elf_info":
+ pwndbg/gdblib/elf.py:103: error: No overload variant of "dict" matches argument type "Struct"  [call-overload]
+ pwndbg/gdblib/elf.py:103: note: Possible overload variants:
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self) -> dict[_KT, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, **kwargs: _VT) -> dict[str, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, SupportsKeysAndGetItem[_KT, _VT], /) -> dict[_KT, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> dict[str, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[tuple[_KT, _VT]], /) -> dict[_KT, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> dict[str, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[list[str]], /) -> dict[str, str]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[list[bytes]], /) -> dict[bytes, bytes]

github-actions[bot] avatar Jan 08 '24 07:01 github-actions[bot]