JHue58 / ChatLearning

基于mirai-api-http,让bot学会你的群的说话方式
GNU Affero General Public License v3.0
313 stars 21 forks source link

在importstock时报错闪退 #76

Closed Redamancy520 closed 1 year ago

Redamancy520 commented 1 year ago

我的词库文件在程序的运行目录下 导入后报错闪退

报错:

欢迎使用ChatLearning应用 版本号: 3.0.3
输入help来查看指令列表吧!
<-开启回复功能

ChatLearning ->importstock aojiao.cl
Traceback (most recent call last):
  File "asyncio\tasks.py", line 258, in __step
  File "prompt_toolkit\application\application.py", line 1070, in _poll_output_size
  File "asyncio\tasks.py", line 654, in sleep
  File "asyncio\futures.py", line 284, in __await__
  File "asyncio\tasks.py", line 328, in __wakeup
  File "asyncio\futures.py", line 196, in result
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "prompt_toolkit\application\application.py", line 1051, in cancel_and_wait_for_background_tasks
  File "asyncio\futures.py", line 284, in __await__
  File "asyncio\tasks.py", line 328, in __wakeup
  File "asyncio\futures.py", line 196, in result
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Chatmain.py", line 2224, in <module>
  File "nest_asyncio.py", line 89, in run_until_complete
  File "asyncio\futures.py", line 201, in result
  File "asyncio\tasks.py", line 258, in __step
  File "Chatmain.py", line 2023, in getcommand_tui
  File "Chatmain.py", line 2117, in commandchoice
  File "Chatmain.py", line 641, in importstock
  File "ChatStock.py", line 57, in load_word_stock
  File "codecs.py", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
[9356] Failed to execute script 'Chatmain' due to unhandled exception!
JHue58 commented 1 year ago

cl后缀的话直接放wordstock文件夹,如果是导入csv的话要为utf-8编码

Redamancy520 commented 1 year ago

放入后直接重启软件即可正常使用吗

JHue58 commented 1 year ago

是的

Redamancy520 commented 1 year ago

ok 谢谢