rhming / UnicomDailyTask

联通日常任务 腾讯云函数定时执行
MIT License
152 stars 77 forks source link

跑微博任务报错 #41

Closed YorkMoon closed 2 years ago

YorkMoon commented 2 years ago

手机Termux上跑的,按 #13 填写相应值,跑微博任务报错。请问怎么解决?

Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner self.run() File "/data/data/com.termux/files/usr/lib/python3.10/threading.py", line 946, in run self._target(*self._args, *self._kwargs) File "/storage/emulated/0/Termux/UnicomDailyTask/activity/unicom/zhuanjifenWeiBo.py", line 219, in run wbsign = json.loads(fp.read()) File "/storage/emulated/0/Termux/UnicomDailyTask/utils/jsonencode.py", line 13, in loads return jsonpickle.loads(value) File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/jsonpickle/unpickler.py", line 49, in decode data = backend.decode(string) File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/jsonpickle/backend.py", line 207, in decode return self.backend_decode(name, string) File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/jsonpickle/backend.py", line 220, in backend_decode return self._decoders[name](string, optargs, decoder_kwargs) File "/data/data/com.termux/files/usr/lib/python3.10/json/init.py", line 359, in loads return cls(kw).decode(s) TypeError: JSONDecoder.init() got an unexpected keyword argument 'encoding'

rhming commented 2 years ago

from utils import jsonencode as json这行改成import json 或者 utils/jsonencode.py文件中 把jsonpickle.set_decoder_options('json', encoding='utf8')改成jsonpickle.set_decoder_options('json')

YorkMoon commented 2 years ago

可以了,非常感谢!