question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
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'

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

6reactions
hiquacommented, 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!

2reactions
lordicommented, 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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found