Pyrogram fork with Adjustable web page preview, Quote Reply, Story & Topics Support, Mongodb session storage, and much more. go to https://pyrofork.wulan17.top/ for documentation.
[ dispatcher.py:342 handler_worker()] 'utf-16-le' codec can't decode bytes in position 10-11: unexpected end of data
Traceback (most recent call last):
File "/home/user/.local/lib/python3.10/site-packages/pyrogram/dispatcher.py", line 329, in handler_worker
await handler.callback(self.client, *args)
File "/home/user/.local/lib/python3.10/site-packages/pyrogram/handlers/message_handler.py", line 151, in resolve_future_or_callback
await self.original_callback(client, message, *args)
File "/mnt/c/bot/handlers/test.py", line 38, in test
print(message.text[:5])
File "/home/user/.local/lib/python3.10/site-packages/pyrogram/types/messages_and_media/message.py", line 57, in __getitem__
return parser_utils.remove_surrogates(parser_utils.add_surrogates(self)[item])
File "/home/user/.local/lib/python3.10/site-packages/pyrogram/parser/utils.py", line 38, in remove_surrogates
return text.encode("utf-16", "surrogatepass").decode("utf-16")
UnicodeDecodeError: 'utf-16-le' codec can't decode bytes in position 10-11: unexpected end of data
Checklist
pip3 install -U git+https://github.com/Mayuri-Chan/pyrofork
and reproduced the issue using the latest development versionDescription
There's a crash in message.text (which, btw, is not str - this is not stated in the documentation, which says message.text is a plain str)...
Steps to reproduce
Add the following message handler to the bot and then write this message anywhere the bot is:
Code example
Logs