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

Probably python3 issue: AttributeError: 'bytes' object has no attribute 'encode' #41

Open
ivoras opened this issue Aug 30, 2017 · 7 comments

Comments

@ivoras
Copy link

ivoras commented Aug 30, 2017

Traceback (most recent call last):
  File "./gethrpc.py", line 2, in <module>
    from ethjsonrpc import EthJsonRpc
  File "/usr/local/lib/python3.5/dist-packages/ethjsonrpc/__init__.py", line 1, in <module>
    from ethjsonrpc.client import (EthJsonRpc, ParityEthJsonRpc,
  File "/usr/local/lib/python3.5/dist-packages/ethjsonrpc/client.py", line 7, in <module>
    from ethereum import utils
  File "/usr/local/lib/python3.5/dist-packages/ethereum/utils.py", line 103, in <module>
    assert sha3('').encode('hex') == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
AttributeError: 'bytes' object has no attribute 'encode'
@lordi
Copy link

lordi commented Sep 10, 2017

Yea, I fixed this locally, but I am a bit hesitant to make a PR because there are so many outstanding issues and PRs. Is this project still maintained?

@hiqua
Copy link

hiqua commented Sep 14, 2017

@lordi whether or not it's still maintained, everyone could benefit from a PR fixing this bug, so don't hesitate to share your version!

@mjmj
Copy link

mjmj commented Jan 24, 2018

Yes, I wish I could see the fix.

@reiven
Copy link

reiven commented Jan 24, 2018

hey @lordi if you send the PR to fix this issue, i can take it and merge it into my fork of this lib https://github.com/reiven/ethjsonrpc

Thanks!

@markusbkoch
Copy link

markusbkoch commented Feb 6, 2018

@tkota0726
Copy link

I think just commment out "assert sha3('').encode('hex') == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'" is enough to avoid this error.

@wellttllew
Copy link

Change it to

assert sha3('').hex() == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'

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

8 participants