OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Pyrogram SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

  • Thread starter Thread starter Hasan
  • Start date Start date
H

Hasan

Guest
I built a telegram bot using Pyrogram and Im trying to deploy it on PythonAnyWhere. I got this error :

Code:
Traceback (most recent call last):
  File "/home/Wle09/Bot-WK-V2.py", line 557, in <module>
    app.run()
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/methods/utilities/run.py", line 84, in run
    self.start()
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/sync.py", line 66, in async_to_sync_wrap
    return loop.run_until_complete(coroutine)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/methods/utilities/start.py", line 58, in start
    is_authorized = await self.connect()
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/methods/auth/connect.py", line 47, in connect
    await self.session.start()
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/session/session.py", line 149, in start
    raise e
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/session/session.py", line 117, in start
    await self.send(raw.functions.Ping(ping_id=0), timeout=self.START_TIMEOUT)
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/session/session.py", line 326, in send
    payload = await self.loop.run_in_executor(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/crypto/mtproto.py", line 50, in pack
    return auth_key_id + msg_key + aes.ige256_encrypt(data + padding, aes_key, aes_iv)
  File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/crypto/aes.py", line 30, in ige256_encrypt
    return tgcrypto.ige256_encrypt(data, key, iv)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

I did some research and i found some solutions like updating library version but all that didn't work

what should i do to solve this problem?
<p>I built a telegram bot using Pyrogram and Im trying to deploy it on PythonAnyWhere.
I got this error :</p>
<pre><code>Traceback (most recent call last):
File "/home/Wle09/Bot-WK-V2.py", line 557, in <module>
app.run()
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/methods/utilities/run.py", line 84, in run
self.start()
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/methods/utilities/start.py", line 58, in start
is_authorized = await self.connect()
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/methods/auth/connect.py", line 47, in connect
await self.session.start()
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/session/session.py", line 149, in start
raise e
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/session/session.py", line 117, in start
await self.send(raw.functions.Ping(ping_id=0), timeout=self.START_TIMEOUT)
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/session/session.py", line 326, in send
payload = await self.loop.run_in_executor(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/crypto/mtproto.py", line 50, in pack
return auth_key_id + msg_key + aes.ige256_encrypt(data + padding, aes_key, aes_iv)
File "/home/Wle09/.local/lib/python3.10/site-packages/pyrogram/crypto/aes.py", line 30, in ige256_encrypt
return tgcrypto.ige256_encrypt(data, key, iv)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
</code></pre>
<p>I did some research and i found some solutions like updating library version but all that didn't work</p>
<p>what should i do to solve this problem?</p>
 

Latest posts

P
Replies
0
Views
1
Paras Chouhan
P
Top