You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error as soon as i start the script:
Start /media/aman/BTC_Blockch/blocks/blk00000.dat in 2019-05-03 17:42:56.161722
Traceback (most recent call last):
File "blockchain-parser.py", line 64, in
b = b.encode('hex').upper()
AttributeError: 'bytes' object has no attribute 'encode'
Ideas?
The text was updated successfully, but these errors were encountered:
It may be the version problem of python. In python3, bytes to hex string is not longer be bytes.encode('hex'). Python3 has a more convenient way, such as bytes.hex(). You can see more detail in https://stackoverflow.com/questions/6624453/whats-the-correct-way-to-convert-bytes-to-a-hex-string-in-python-3 . As for your question, you can try to replace all b=b.encode('hex').upper()
to b=b.hex().upper() if you are using python3. In addition, if you see another problem "str" object has no attribute 'decode', you can use bytes.fromhex(your_bytes).
I make some changes, and now script working with Python 3.8 or higher. It seems that newer version of Python produces more fast parsing and that's why script now compatible with highest versions of Python interpreter without support of oldest.
I get the following error as soon as i start the script:
Start /media/aman/BTC_Blockch/blocks/blk00000.dat in 2019-05-03 17:42:56.161722
Traceback (most recent call last):
File "blockchain-parser.py", line 64, in
b = b.encode('hex').upper()
AttributeError: 'bytes' object has no attribute 'encode'
Ideas?
The text was updated successfully, but these errors were encountered: