weibo_daily_hotkey icon indicating copy to clipboard operation
weibo_daily_hotkey copied to clipboard

配置好conf.cfg报错如下

Open jinyue806 opened this issue 5 years ago • 1 comments

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

jinyue806 avatar Dec 28 '19 15:12 jinyue806

原项目是运行在linux下的,你在windows运行会读取文件时编码错误,read函数里面加上uft-8编码的参数试试

pengber avatar Feb 23 '20 04:02 pengber