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

Bug: \参数输出转义 #74

Open
fu050409 opened this issue Sep 18, 2023 · 4 comments
Open

Bug: \参数输出转义 #74

fu050409 opened this issue Sep 18, 2023 · 4 comments
Labels
question Further information is requested

Comments

@fu050409
Copy link

fu050409 commented Sep 18, 2023

操作系统

Windows/Linux/MacOS均出现

Python 版本

3.10.12

NoneBot 版本

2.1.0

适配器

Onebot v11

协议端

go-cqhttp

描述问题

日志输出错误:

09-18 22:28:54 [INFO] nonebot | Event will be handled by Matcher(type='message', module=dicergirl, lineno=80)
09-18 22:28:54 [INFO] nonebot | Matcher(type='message', module=dicergirl, lineno=80) running complete
Task exception was never retrieved
future: <Task finished name='Task-8213' coro=<Bot.handle_event() done, defined at /root/oracle-dicer/.venv/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/bot.py:186> exception=ValueError('Closing tag "</le>" has no corresponding opening tag')>
Traceback (most recent call last):
  File "/root/oracle-dicer/.venv/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/bot.py", line 194, in handle_event
    await handle_event(self, event)
  File "/root/oracle-dicer/.venv/lib/python3.10/site-packages/nonebot/message.py", line 497, in handle_event
    logger.opt(colors=True).success(log_msg)
  File "/root/oracle-dicer/.venv/lib/python3.10/site-packages/loguru/_logger.py", line 2018, in success
    __self._log("SUCCESS", False, __self._options, __message, args, kwargs)
  File "/root/oracle-dicer/.venv/lib/python3.10/site-packages/loguru/_logger.py", line 1987, in _log
    colored_message = Colorizer.prepare_simple_message(str(message))
  File "/root/oracle-dicer/.venv/lib/python3.10/site-packages/loguru/_colorizer.py", line 368, in prepare_simple_message
    parser.feed(string)
  File "/root/oracle-dicer/.venv/lib/python3.10/site-packages/loguru/_colorizer.py", line 244, in feed
    raise ValueError('Closing tag "%s" has no corresponding opening tag' % markup)
ValueError: Closing tag "</le>" has no corresponding opening tag

复现步骤

监听一个消息事件,例如on_startswith("xxx"),然后发送消息:\+图片(一个反斜杠+图片)

怀疑是\转义了CQ码的[而导致输出错误。

期望的结果

No response

截图或日志

No response

@fu050409 fu050409 added the bug Something isn't working label Sep 18, 2023
@yanyongyu
Copy link
Member

请检查你的onebot适配器版本是否为最新

@yanyongyu yanyongyu added question Further information is requested and removed bug Something isn't working labels Sep 18, 2023
@fu050409
Copy link
Author

fu050409 commented Sep 18, 2023

请检查你的onebot适配器版本是否为最新

root@unvisitor:~/oracle-dicer# nb adapter install nonebot-adapter-onebot --upgrade -i https://pypi.org/simple
使用 Python: /root/oracle-dicer/.venv/bin/python
Requirement already satisfied: nonebot-adapter-onebot in ./.venv/lib/python3.10/site-packages (2.2.4)

没有发现新版本,应该是最新的。

@yanyongyu yanyongyu transferred this issue from nonebot/nonebot2 Sep 18, 2023
@yanyongyu
Copy link
Member

复现了一下 '\\<le>[image:file=https://xxx.xxx/,cache=true,proxy=true]</le>' 无法被loguru输出

@yanyongyu
Copy link
Member

目前这个问题是上游loguru导致的,暂时无法修复,等待上游给出解决方案

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants