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

unicode decode error #16

Open
zyren123 opened this issue Jan 7, 2024 · 2 comments
Open

unicode decode error #16

zyren123 opened this issue Jan 7, 2024 · 2 comments

Comments

@zyren123
Copy link

zyren123 commented Jan 7, 2024

(reader) E:\ai_code_reader>python main.py
Traceback (most recent call last):
File "E:\ai_code_reader\main.py", line 113, in
config.init_config()
File "E:\ai_code_reader\config.py", line 18, in init_config
config.read('.env')
File "D:\anaconda3\envs\reader\lib\configparser.py", line 698, in read
self._read(fp, filename)
File "D:\anaconda3\envs\reader\lib\configparser.py", line 1021, in _read
for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 29: illegal multibyte sequence

@jiaheng6
Copy link

jiaheng6 commented Jan 7, 2024

config.py文件有一行“config.read('.env')”,改成“config.read('.env', encoding='utf-8')”

@jiaheng6
Copy link

jiaheng6 commented Jan 7, 2024

(阅读器) E:\ai_code_reader>python main.py 回溯(最近一次调用): 文件“E:\ai_code_reader\main.py”,第113行,在 config.init_config() 文件“E:\ai_code_reader\config 。py”,第18行,在init_config config.read('.env') 文件“D:\anaconda3\envs\reader\lib\configparser.py”,第698行,在read self._read(fp, filename) 文件“ D:\anaconda3\envs\reader\lib\configparser.py”,第 1021 行,在 _read for lineno 中,枚举行(fp,start=1): UnicodeDecodeError:“gbk”编解码器无法解码位置 29中的字节 0xae :非法多字节序列

config.py文件有一行“config.read('.env')”,改成“config.read('.env',encoding='utf-8')”

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

No branches or pull requests

2 participants