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

配置好conf.cfg报错如下 #3

Open
jinyue806 opened this issue Dec 28, 2019 · 1 comment
Open

配置好conf.cfg报错如下 #3

jinyue806 opened this issue Dec 28, 2019 · 1 comment

Comments

@jinyue806
Copy link

conf.cfg配置如下
[redis]
host=127.0.0.0
port=6379
passwd=123456
[file]
path=data/data.md
[git]
path=C:/Users/Administrator/Desktop/weibo_daily_hotkey-master
filepath=data/data.md

以下是执行企业微信自动推送需要的

[qywx]
tokens=
[monitor]
keys=123,456
hot_count=10000

Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/weibo_daily_hotkey-master/cronjob.py", line 28, in
cfg = ConfigCenter.MonitorConfig()
File "C:\Users\Administrator\Desktop\weibo_daily_hotkey-master\util\configcenter\config_center.py", line 35, in MonitorConfig
cfg = ConfigReader.read_section_key('conf', 'base.cfg', 'monitor', *k)
File "C:\Users\Administrator\Desktop\weibo_daily_hotkey-master\util\base\config.py", line 40, in read_section_key
conf = Config(path_name=path_name, file_name=file_name, section_name=section_name)
File "C:\Users\Administrator\Desktop\weibo_daily_hotkey-master\util\base\config.py", line 12, in init
self.config.read(self.filepath)
File "C:\Anaconda3\lib\configparser.py", line 696, in read
self._read(fp, filename)
File "C:\Anaconda3\lib\configparser.py", line 1014, in _read
for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 194: illegal multibyte sequence

@pengber
Copy link

pengber commented Feb 23, 2020

原项目是运行在linux下的,你在windows运行会读取文件时编码错误,read函数里面加上uft-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