Skip to content

BaseException: err raised in opentele.utils during TDesktop import #145

Description

@lumoknight

Describe the bug

I used the given sample code to convert Telegram Desktop tdata into a Telethon session, but it fails immediately on import with an exception from the opentele package.

To Reproduce

Steps to reproduce the behavior:

  1. Install opentele and its dependencies as shown in the documentation.
  2. Create a script (e.g. tdatacode.py) using the provided sample code:
    from opentele.td import TDesktop
  3. Run the script:
    python tdatacode.py
  4. The script crashes on startup with an exception.

Expected behavior

The tdata should be successfully converted into a Telethon session using the provided sample code, without throwing any exceptions.

Additional context

  • OS: Windows
  • Python version: 3.13
  • I did not modify the sample code in any way; I only ran it as provided.
  • Full traceback:
[__firstlineno__] 1407xxx - 14070xxx
Traceback (most recent call last):
  File "c:\Users\xxx\Desktop\clone_session\tdatacode.py", line 1, in <module>
    from opentele.td import TDesktop
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\__init__.py", line 1, in <module>
    from . import td
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\td\__init__.py", line 2, in <module>
    from .shared import *
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\td\shared.py", line 4, in <module>
    from .account import Account, StorageAccount, MapData
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\td\account.py", line 3, in <module>
    from .configs import *
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\td\configs.py", line 8, in <module>
    from .. import tl
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\tl\__init__.py", line 1, in <module>
    from .shared import *
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\tl\shared.py", line 1, in <module>
    from .telethon import TelegramClient
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\tl\telethon.py", line 65, in <module>
    @extend_class
     ^^^^^^^^^^^^
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python313\Lib\site-packages\opentele\utils.py", line 121, in __new__
    raise BaseException("err")
BaseException: err

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions