You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am sure the error is coming from Pyrogram's code and not elsewhere
I have searched in the issue tracker for similar bug reports, including closed ones
I ran pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip and reproduced the issue using the latest development version
Description
If received message with normal and/or animated emoji (Works perfectly with lots of emoji!)
But this one always runs to error: 👉 250 likes .
I mention it because I keep coming across it and I don't know if there will be more emoji like this in the future
(Pyrogram 2.1.32)
Steps to reproduce
use this emoji in message : 👉
Code example
@app.on_message(filters.all)asyncdefon_message(client: Client, message: Message)
....
curr_msg=message.textormessage.caption
....
is_live=Falseifcurr_msg[0] =='*'elseTrue---------------------------------------/parser/utils.pyIchangedtheerror type from"surrogatepass"to"ignore". Notsureifit'sagoodsolution, butitallowsmetocontinueprogrammingtemporarilydefremove_surrogates(text: str) ->str:
# Replace each surrogate pair with a SMP code pointreturntext.encode("utf-16", "surrogatepass").decode("utf-16")
Logs
2024-11-26 18:55:51,929 - pyrogram.dispatcher - ERROR - 'utf-16-le' codec can't decode bytes in position 2-3: unexpected end of dataTraceback (most recent call last): File "D:\Programming\Python\TelegramBot\.venv\lib\site-packages\pyrogram\dispatcher.py", line 313, in handler_worker await handler.callback(self.client, *args) File "D:\Programming\Python\TelegramBot\tgRun.py", line 433, in on_message is_live = False if curr_msg[0] == '*' else True File "D:\Programming\Python\TelegramBot\.venv\lib\site-packages\pyrogram\types\messages_and_media\message.py", line 56, in __getitem__ return parser_utils.remove_surrogates(parser_utils.add_surrogates(self)[item]) File "D:\Programming\Python\TelegramBot\.venv\lib\site-packages\pyrogram\parser\utils.py", line 37, in remove_surrogates return text.encode("utf-16", "surrogatepass").decode("utf-16")UnicodeDecodeError: 'utf-16-le' codec can't decode bytes in position 2-3: unexpected end of data
The text was updated successfully, but these errors were encountered:
Checklist
pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip
and reproduced the issue using the latest development versionDescription
If received message with normal and/or animated emoji (Works perfectly with lots of emoji!)
But this one always runs to error: 👉 250 likes .
I mention it because I keep coming across it and I don't know if there will be more emoji like this in the future
(Pyrogram 2.1.32)
Steps to reproduce
use this emoji in message : 👉
Code example
Logs
The text was updated successfully, but these errors were encountered: