Probably python3 issue: AttributeError: 'bytes' object has no attribute 'encode'
See original GitHub issueTraceback (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'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
AttributeError:'bytes' object has no attribute 'encode'
chr returns a string that gets multiplied and encoded as bytes. · Python2 strings are implicitly bytes objects while Python3 strings are unicode....
Read more >Fixed AttributeError: 'bytes' object has no attribute 'encode' #229
The key field already be decode in Python 3. So I add a condition statement to check version of python to fix this...
Read more >AttributeError when trying to send an utf-8 encoded email with ...
I get "AttributeError: 'bytes' object has no attribute 'encode'" when trying to send a utf-8 encoded email with text attachments (see stack trace...
Read more >AttributeError: 'bytes' object has no attribute 'encode'
It's probably something later in the code that is reassigning message to a bytes object - perhaps you're reassigning it the data received...
Read more >Sending mails with attachment results in 'bytes' object has no ...
File "/usr/lib64/python3.5/email/mime/text.py", line 34, in __init__ _text.encode('us-ascii') AttributeError: 'bytes' object has no attribute 'encode'
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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!
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?