ethjsonrpc
ethjsonrpc copied to clipboard
Probably python3 issue: AttributeError: 'bytes' object has no attribute 'encode'
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'
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?
@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!
Yes, I wish I could see the fix.
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!
Have you guys seen this? https://github.com/suryanash/ethjsonrpc/commit/587959177a3378ce58505b777d9b87baf685909d
I think just commment out "assert sha3('').encode('hex') == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'" is enough to avoid this error.
Change it to
assert sha3('').hex() == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'