-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[BUG]Markdown 渲染失败,使用备用模式 #251
Comments
Windows10系统 2023-03-04 09:17:48.211 | SUCCESS | launart.manager:launch:384 - Layer #1:[cache.client/memcache, http.client/aiohttp] preparation completed. File "D:\GPTqq\chatgpt\bot.py", line 291, in File "D:\GPTqq\chatgpt\python3.9\lib\site-packages\graia\ariadne\app.py", line 312, in launch_blocking File "D:\GPTqq\chatgpt\python3.9\lib\site-packages\launart\manager.py", line 494, in launch_blocking File "asyncio\base_events.py", line 634, in run_until_complete File "asyncio\windows_events.py", line 321, in run_forever File "asyncio\base_events.py", line 601, in run_forever File "asyncio\base_events.py", line 1905, in _run_once File "asyncio\events.py", line 80, in _run File "D:\GPTqq\chatgpt\python3.9\lib\site-packages\graia\broadcast_init_.py", line 191, in Executor File "D:\GPTqq\chatgpt\python3.9\lib\site-packages\graia\broadcast\utilles.py", line 34, in run_always_await File "D:\GPTqq\chatgpt\bot.py", line 227, in start_background File "D:\GPTqq\chatgpt\utils\text_to_img.py", line 368, in to_image
ValueError: I/O operation on closed file |
v2.0.1 已修复 |
提交 issue 前,请先确认:
表现
向bot发送消息后日志中显示Markdown 渲染失败,使用备用模式。
运行环境:
复现步骤
描述你是如何触发这个 BUG 的
截图
chatgpt-qq-mirai-1 | 2023-03-04 01:00:10 V/Bot.2463724346: Moki.(2657447616) -> 你好
chatgpt-qq-chatgpt-1 | 2023-03-04 01:00:10.199 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 你好
chatgpt-qq-chatgpt-1 | 2023-03-04 01:00:10.207 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时……
chatgpt-qq-chatgpt-1 | 2023-03-04 01:00:10.209 | DEBUG | adapter.chatgpt.web:preset_ask:86 - [预设] 发送:
chatgpt-qq-chatgpt-1 | 2023-03-04 01:00:10.840 | DEBUG | adapter.chatgpt.web:preset_ask:88 - [预设] Chatbot 回应:Hello! How can I assist you today?
chatgpt-qq-chatgpt-1 | 2023-03-04 01:00:12.079 | ERROR | utils.text_to_img:text_to_image:359 - I/O operation on closed file
chatgpt-qq-chatgpt-1 | Traceback (most recent call last):
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 291, in
chatgpt-qq-chatgpt-1 | app.launch_blocking()
chatgpt-qq-chatgpt-1 | │ └ <classmethod object at 0x7f789190ba30>
chatgpt-qq-chatgpt-1 | └ <graia.ariadne.app.Ariadne object at 0x7f78c340db20>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/graia/ariadne/app.py", line 312, in launch_blocking
chatgpt-qq-chatgpt-1 | cls.launch_manager.launch_blocking(loop=cls.service.loop, stop_signal=stop_signals)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ (<Signals.SIGINT: 2>,)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <property object at 0x7f789190ef40>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <graia.ariadne.service.ElizabethService object at 0x7f78c33a5a30>
chatgpt-qq-chatgpt-1 | │ │ │ └ <class 'graia.ariadne.app.Ariadne'>
chatgpt-qq-chatgpt-1 | │ │ └ <function Launart.launch_blocking at 0x7f7892af2b80>
chatgpt-qq-chatgpt-1 | │ └ <launart.manager.Launart object at 0x7f7890bb5970>
chatgpt-qq-chatgpt-1 | └ <class 'graia.ariadne.app.Ariadne'>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/launart/manager.py", line 494, in launch_blocking
chatgpt-qq-chatgpt-1 | loop.run_until_complete(launch_task)
chatgpt-qq-chatgpt-1 | │ │ └ <Task pending name='amnesia-launch' coro=<Launart.launch() running at /usr/local/lib/python3.9/site-packages/launart/manager....
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_until_complete at 0x7f78c20d58b0>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete
chatgpt-qq-chatgpt-1 | self.run_forever()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_forever at 0x7f78c20d5820>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 601, in run_forever
chatgpt-qq-chatgpt-1 | self._run_once()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop._run_once at 0x7f78c20d93a0>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once
chatgpt-qq-chatgpt-1 | handle._run()
chatgpt-qq-chatgpt-1 | │ └ <function Handle._run at 0x7f78c20f6dc0>
chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f78900e3f70>()>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
chatgpt-qq-chatgpt-1 | self._context.run(self._callback, *self._args)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <member '_args' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <Handle <TaskStepMethWrapper object at 0x7f78900e3f70>()>
chatgpt-qq-chatgpt-1 | │ │ │ └ <member '_callback' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ └ <Handle <TaskStepMethWrapper object at 0x7f78900e3f70>()>
chatgpt-qq-chatgpt-1 | │ └ <member '_context' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f78900e3f70>()>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 155, in request
chatgpt-qq-chatgpt-1 | async for rendered in task:
chatgpt-qq-chatgpt-1 | │ └ <async_generator object ConversationContext.ask at 0x7f78900df4c0>
chatgpt-qq-chatgpt-1 | └ None
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/conversation.py", line 44, in ask
chatgpt-qq-chatgpt-1 | yield await self.renderer.result()
chatgpt-qq-chatgpt-1 | │ │ └ <function MarkdownImageRenderer.result at 0x7f7890cabb80>
chatgpt-qq-chatgpt-1 | │ └ <renderer.renderer.MarkdownImageRenderer object at 0x7f7890241940>
chatgpt-qq-chatgpt-1 | └ <conversation.ConversationContext object at 0x7f7890b60b80>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/renderer/renderer.py", line 34, in result
chatgpt-qq-chatgpt-1 | return await to_image(self.msg)
chatgpt-qq-chatgpt-1 | │ │ └ '你好!有什么我可以帮助你的吗?'
chatgpt-qq-chatgpt-1 | │ └ <renderer.renderer.MarkdownImageRenderer object at 0x7f7890241940>
chatgpt-qq-chatgpt-1 | └ <function to_image at 0x7f7890cab790>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/utils/text_to_img.py", line 368, in to_image
chatgpt-qq-chatgpt-1 | img = await text_to_image(text=text)
chatgpt-qq-chatgpt-1 | │ └ '你好!有什么我可以帮助你的吗?'
chatgpt-qq-chatgpt-1 | └ <function text_to_image at 0x7f7890cab700>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | > File "/app/utils/text_to_img.py", line 333, in text_to_image
chatgpt-qq-chatgpt-1 | with StringIO(output_file.getvalue()) as input_file:
chatgpt-qq-chatgpt-1 | │ │ └ <method 'getvalue' of '_io.StringIO' objects>
chatgpt-qq-chatgpt-1 | │ └ <_io.StringIO object at 0x7f78900df430>
chatgpt-qq-chatgpt-1 | └ <class '_io.StringIO'>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | ValueError: I/O operation on closed file
chatgpt-qq-chatgpt-1 | 2023-03-04 01:00:12.089 | ERROR | utils.text_to_img:text_to_image:360 - Markdown 渲染失败,使用备用模式
chatgpt-qq-chatgpt-1 | 2023-03-04 01:00:12.203 | DEBUG | middlewares.timeout:handle_respond:44 - [Timeout] 取消计时……
The text was updated successfully, but these errors were encountered: