Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Binding: The name attribute in many classes are now of type object #965

Closed
fzakaria opened this issue Sep 11, 2023 · 3 comments
Closed
Assignees
Labels

Comments

@fzakaria
Copy link
Contributor

I noticed the latest documentation online and the latest source on main has the type object for the name attribute.

For instance:

property name → object
Section’s name

I checked the source and Section's name property in the C++ file is of type string (https://github.com/lief-project/LIEF/blob/master/include/LIEF/Abstract/Section.hpp#L43)

Seems like something is causing the wrong type annotations.

fzakaria added a commit to fzakaria/sqlelf that referenced this issue Sep 11, 2023
Lot of changes to the types in the recent lief.
* removed name from Binary
* no name for section/symbol of type str
  (lief-project/LIEF#965)
* created a proxy class Binary
* added pyright to check tests folder
fzakaria added a commit to fzakaria/sqlelf that referenced this issue Sep 11, 2023
* bump lief to most recent main

* bump lief to most recent main
  (3414ded8cdcbd9705f7871c66c212b15cd74ea69)
* created new nix directory and moved overlay there
* had to copy lief derivation from nixpkg for now since lief changed how
  it is built.

* Type annotation fixes

Lot of changes to the types in the recent lief.
* removed name from Binary
* no name for section/symbol of type str
  (lief-project/LIEF#965)
* created a proxy class Binary
* added pyright to check tests folder
@romainthomas
Copy link
Member

Actually the correct annotation should be str | bytes. bytes if somehow the string can't be decoded in Python.
I'll fix it.

@fzakaria
Copy link
Contributor Author

fzakaria commented Sep 14, 2023

Symbols and sections have a fullname attribute that is only str though.
(On phone but the attribute is the name with potential null characters)

@romainthomas
Copy link
Member

Indeed, I'll fix it as well. It should be bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants