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

[Feature request] Add PosixPath object support for python r2pipe #109

Open
dukebarman opened this issue Dec 24, 2019 · 0 comments
Open

[Feature request] Add PosixPath object support for python r2pipe #109

dukebarman opened this issue Dec 24, 2019 · 0 comments

Comments

@dukebarman
Copy link

In Python3 if you use pathlib module for parsing files from a directory, you get results in PosixPath objects. When you send it to r2 = r2pipe.open(filename), you receive an error:

File "main.py", line 30, in is_binary
    r2 = r2pipe.open(filename)
  File "/usr/local/lib/python3.7/site-packages/r2pipe/open_sync.py", line 32, in __init__
    super(open, self).__init__(filename, flags)
  File "/usr/local/lib/python3.7/site-packages/r2pipe/open_base.py", line 132, in __init__
    if filename.startswith("#!pipe"):
AttributeError: 'PosixPath' object has no attribute 'startswith'

And you need convert this path to string: r2 = r2pipe.open(str(filename)). It would be good add support or check this functionality in r2pipe python module.

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

No branches or pull requests

1 participant