Cannot import eth_utils on a Windows PC where the system language is Chinese.
Code that produced the error
import eth_utils
Full error output
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Leo_h\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_utils\__init__.py", line 86, in <module>
from .network import (
File "C:\Users\Leo_h\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_utils\network.py", line 49, in <module>
networks = initialize_network_objects()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Leo_h\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_utils\network.py", line 27, in initialize_network_objects
network_data = json.load(open_file)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Leo_h\AppData\Local\Programs\Python\Python311\Lib\json\__init__.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^
UnicodeDecodeError: 'gbk' codec can't decode byte 0x88 in position 247555: illegal multibyte sequence
Fill this section in if you know how this could or should be fixed
I found a character '◈' in eth_networks.json, which may have caused this problem. I suggest specifying UTF-8 encoding explicitly when parsing this file.
What happened?
Cannot import eth_utils on a Windows PC where the system language is Chinese.
Code that produced the error
Full error output
Fill this section in if you know how this could or should be fixed
I found a character '◈' in
eth_networks.json
, which may have caused this problem. I suggest specifyingUTF-8
encoding explicitly when parsing this file.eth-utils Version
2.3.0
Python Version
3.11.3
Operating System
Windows 10 22H2
Output from
pip freeze