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

web3_sha3 not working under Python 2.7 on MacOS #37

Open
jansenmarc opened this issue Jul 6, 2017 · 2 comments
Open

web3_sha3 not working under Python 2.7 on MacOS #37

jansenmarc opened this issue Jul 6, 2017 · 2 comments

Comments

@jansenmarc
Copy link

Dear all,

i encountered some problem with the web3_sha3 rpc method on Mac OS with Python 2.7. Actually, line 150 in client.py does not reaturn a hex string starting with 0x. Since i assume that this is a Mac specific problem, otherwise other should have encountered it also, i would suggest to add something like:

if not data.startsWith('0x'):
data = '0x' + data

@srya-b
Copy link

srya-b commented Oct 2, 2017

Even with '0x' at the start of data it still throws errors for me for any data that I give it. I've tried manually giving it something like 0x1234. I saw in the code that it actually does data = str(data).encode('hex') in the call, so I tried just putting in a string or a number, but nothing seems to be accepted by Geth. I continuously get

ethjsonrpc.exceptions.BadResponseError: {u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'invalid argument 0: json: cannot unmarshal hex string without 0x prefix into Go value of type hexutil.Bytes', u'code': -32602}}

@fjblau
Copy link

fjblau commented Nov 12, 2017

I am also getting the same thing no matter what I do. MacOS, Python2.7...

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

3 participants