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

Python3 Script "a bytes-like object is required" #79

Closed
0xchase opened this issue Nov 18, 2018 · 2 comments
Closed

Python3 Script "a bytes-like object is required" #79

0xchase opened this issue Nov 18, 2018 · 2 comments

Comments

@0xchase
Copy link

0xchase commented Nov 18, 2018

I hope I'm not doing something wrong.
It works fine when running the script on its own, but fails if run with r2 -i <script> . This issues appears to be similar to #64 and #57 but I can't figure out how to implement the fix.

Versions

$ radare2 -v
radare2 3.1.0-git 20082 @ linux-x86-64 git.3.0.1-273-g6d0f9ce
commit: 6d0f9ce282926af91d1350acaf4722a56a0467b0 build: 2018-11-18__13:29:11
$ pip freeze | grep r2pipe
r2pipe==0.9.9

Python3 script

$ cat r2.py 
import r2pipe
r = r2pipe.open()
r.cmd('aaa')

Running the script

$ r2 -i r2.py test.x 
Traceback (most recent call last):
  File "r2.py", line 4, in <module>
    r.cmd('aaa')
  File "/home/ck/.local/lib/python3.5/site-packages/r2pipe/__init__.py", line 274, in cmd
    res = self._cmd(cmd)
  File "/home/ck/.local/lib/python3.5/site-packages/r2pipe/__init__.py", line 214, in _cmd_pipe
    os.write(self.pipe[1], cmd)
TypeError: a bytes-like object is required, not 'str'
 -- Use zoom.byte=entropy and press 'z' in visual mode to zoom out to see the entropy of the whole file
[0x004004c0]> 
@a1ext
Copy link
Contributor

a1ext commented Dec 6, 2018

@chase1635321 could you check with new 1.1.0 version?

@a1ext
Copy link
Contributor

a1ext commented Dec 13, 2018

I think it is solved, feel free to reopen an issue otherwise

@a1ext a1ext closed this as completed Dec 13, 2018
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

2 participants