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

解决在windows 10系统下报gbk编码错误的问题 #3

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

nl8590687
Copy link
Contributor

实测代码在windows 10系统Python 3.6下运行报错:
Traceback (most recent call last):
File ".\generate_data.py", line 13, in
amap_code_to_city = load_amap_cities()
File ".\generate_data.py", line 10, in load_amap_cities
return dict([line.strip().split() for line in open('adcodes').readlines()])
UnicodeDecodeError: 'gbk' codec can't decode byte 0x82 in position 15: illegal multibyte sequence

运行环境:
Windows 10
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32

修改后:
运行通过

实测代码在windows 10系统Python 3.6下运行报错:
Traceback (most recent call last):
  File ".\generate_data.py", line 13, in <module>
    amap_code_to_city = load_amap_cities()
  File ".\generate_data.py", line 10, in load_amap_cities
    return dict([line.strip().split() for line in open('adcodes').readlines()])
UnicodeDecodeError: 'gbk' codec can't decode byte 0x82 in position 15: illegal multibyte sequence

运行环境:
Windows 10
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32

修改后:
运行通过
@Juster07
Copy link

win7 +1,感谢

@lispczz lispczz merged commit 6761d77 into lispc:master Jan 28, 2020
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

Successfully merging this pull request may close these issues.

3 participants