opentele icon indicating copy to clipboard operation
opentele copied to clipboard

RecursionError: maximum recursion depth exceeded in comparison

Open Spartaques opened this issue 2 years ago • 7 comments

I get RecursionError: maximum recursion depth exceeded in comparison when i try to start many sessions using asyncio

This is my code: image image

It works for 8 iterations, and fails with RecursionError Stacktrace: image

What i'm doing wrong? Or it's bug? Works perfect with only one session

Spartaques avatar Apr 23 '22 17:04 Spartaques

The same issue, everything was good with one account at tdata if more than get 'maximum recursion depth exceeded'

Ch4ttY avatar May 25 '22 20:05 Ch4ttY

I have the same problem . With one tdata record. Apparently it depends on the specific tdata. Some are converted, others are not. I purchased 3 tdata accounts, when converting, each of them has the same problem, the accounts are working.

File "D:\Проекты python\TdataToTelethon\venv\lib\site-packages\opentele\td\tdesktop.py", line 666, in api account.api = value File "D:\Проекты python\TdataToTelethon\venv\lib\site-packages\opentele\td\account.py", line 679, in api self.owner.api = self.api File "D:\Проекты python\TdataToTelethon\venv\lib\site-packages\opentele\td\tdesktop.py", line 666, in api account.api = value File "D:\Проекты python\TdataToTelethon\venv\lib\site-packages\opentele\td\account.py", line 679, in api self.owner.api = self.api File "D:\Проекты python\TdataToTelethon\venv\lib\site-packages\opentele\td\tdesktop.py", line 666, in api account.api = value File "D:\Проекты python\TdataToTelethon\venv\lib\site-packages\opentele\td\account.py", line 678, in api RecursionError: maximum recursion depth exceeded

slaid098 avatar May 27 '22 19:05 slaid098

Unfortunately, I couldn't replicate this bug, can you provide more information? This recursive error is weird, I don't understand how it could happen. Can you change the tdesktop.py line 666 From this:

 account.api = value

To this:

if account.api != value:
    account.api = value

And see what would happen?

thedemons avatar May 28 '22 02:05 thedemons

Unfortunately, I couldn't replicate this bug, can you provide more information? This recursive error is weird, I don't understand how it could happen. Can you change the tdesktop.py line 666 From this:

 account.api = value

To this:

if account.api != value:
    account.api = value

And see what would happen?

I tried it and nothing changed. P.S To reproduce the error try to convert tdata which contains at least 2 accounts or more, the error does not occur if the account is one

Ch4ttY avatar May 28 '22 14:05 Ch4ttY

if account.api != value:
    account.api = value
tdesk = TDesktop("tdata", api=oldAPI)

File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\opentele\td\tdesktop.py", line 141, in init self.LoadTData() File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\opentele\td\tdesktop.py", line 203, in LoadTData self.__loadFromTData() File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\opentele\td\tdesktop.py", line 438, in __loadFromTData account = td.Account( File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\opentele\td\account.py", line 661, in init self.api = api.copy() File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\opentele\td\account.py", line 679, in api self.owner.api = self.api File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\opentele\td\tdesktop.py", line 667, in api

Here's the beginning of the recursion issue

faredus avatar May 29 '22 21:05 faredus

Any updates?

Ch4ttY avatar Jun 25 '22 08:06 Ch4ttY

in tdesktop.py, comment two lines

    @api.setter
    def api(self, value) -> None:
        self.__api = value
        # for account in self.accounts:
        #     account.api = value

gamereg avatar Aug 25 '22 09:08 gamereg

The fix above works on the multi-account tdata and is selects one of the accounts

ruperson avatar Dec 19 '22 12:12 ruperson