相关报错信息
01-11 22:35:01 [SUCCESS] nonebot | OneBot V11 3446001887 | [message.private.friend]: Message 1924661483 from 1075818**** "头像表情包"
01-11 22:35:01 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_petpet)
01-11 22:35:02 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_petpet) running complete
01-11 22:35:02 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_petpet) failed.
Traceback (most recent call last):`
File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 976, in truetype
return freetype(font)
File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 973, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 249, in init
self.font = core.getfont(
OSError: invalid pixel size
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/nonebot/message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "/opt/homebrew/lib/python3.9/site-packages/nonebot/message.py", line 188, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/opt/homebrew/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/opt/homebrew/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run
await handler(
File "/opt/homebrew/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(*values)
File "/opt/homebrew/lib/python3.9/site-packages/nonebot_pluginpetpet/init.py", line 111, in
img = await help_image(user_id, memes)
File "/opt/homebrew/lib/python3.9/site-packages/nonebot/utils.py", line 113, in _wrapper
result = await loop.run_in_executor(None, pfunc)
File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(self.args, **self.kwargs)
File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_petpet/init.py", line 79, in help_image
imgs.append(Text2Image.from_bbcode_text(text, 30).to_image(padding=(20, 10)))
File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_imageutils/text2image.py", line 336, in from_bbcode_text
Char(
File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_imageutils/text2image.py", line 33, in init
self.pilfont = self.font.load_font(fontsize)
File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_imageutils/fonts.py", line 147, in load_font
return ImageFont.truetype(str(self.path), fontsize, encoding="utf-8")
File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 1010, in truetype
return freetype(os.path.join(walkroot, walkfilename))
File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 973, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 249, in init
self.font = core.getfont(
OSError: invalid pixel size`
问题描述 在任意有bot的群聊(私聊)发送
头像表情包
触发插件响应,但无结果返回,终端查看发现报错。插件版本 0.3.19 注:先前版本貌似不会引发报错,更新之后出现该问题
相关报错信息 01-11 22:35:01 [SUCCESS] nonebot | OneBot V11 3446001887 | [message.private.friend]: Message 1924661483 from 1075818**** "头像表情包" 01-11 22:35:01 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_petpet) 01-11 22:35:02 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_petpet) running complete 01-11 22:35:02 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_petpet) failed. Traceback (most recent call last):` File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 976, in truetype return freetype(font) File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 973, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 249, in init self.font = core.getfont( OSError: invalid pixel size
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/homebrew/lib/python3.9/site-packages/nonebot/message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "/opt/homebrew/lib/python3.9/site-packages/nonebot/message.py", line 188, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/opt/homebrew/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 727, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/opt/homebrew/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run await handler( File "/opt/homebrew/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(*values) File "/opt/homebrew/lib/python3.9/site-packages/nonebot_pluginpetpet/init.py", line 111, in img = await help_image(user_id, memes) File "/opt/homebrew/lib/python3.9/site-packages/nonebot/utils.py", line 113, in _wrapper result = await loop.run_in_executor(None, pfunc) File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_petpet/init.py", line 79, in help_image imgs.append(Text2Image.from_bbcode_text(text, 30).to_image(padding=(20, 10))) File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_imageutils/text2image.py", line 336, in from_bbcode_text Char( File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_imageutils/text2image.py", line 33, in init self.pilfont = self.font.load_font(fontsize) File "/opt/homebrew/lib/python3.9/site-packages/nonebot_plugin_imageutils/fonts.py", line 147, in load_font return ImageFont.truetype(str(self.path), fontsize, encoding="utf-8") File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 1010, in truetype return freetype(os.path.join(walkroot, walkfilename)) File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 973, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/opt/homebrew/lib/python3.9/site-packages/PIL/ImageFont.py", line 249, in init self.font = core.getfont( OSError: invalid pixel size`