Replace unmaintained opentele with opentele2 (Python 3.13 support)#26
Replace unmaintained opentele with opentele2 (Python 3.13 support)#26SINSQQ wants to merge 5 commits into
Conversation
…2>=1.2.1 opentele is no longer maintained and is not installable on Python 3.13 (it raises a hard-coded BaseException at import time). opentele2 is the maintained drop-in fork that exposes the same `opentele.td` surface this library relies on. Pin opentele2>=1.2.1 — the first release that ships Python 3.13 wheels and matches the TDATA API used by TGConvertor (TDesktop, Account, AuthKeyType, AuthKey, DcId).
opentele is unmaintained and breaks on Python 3.13 due to a hard-coded BaseException raised at import time inside opentele.utils. opentele2 is the maintained fork with a fully compatible API (TDesktop, Account, AuthKeyType, AuthKey, DcId) and active Python 3.13 support, so the only required change is the import path. This restores TDATA conversion on Python 3.13+ while keeping the same public surface for users on older Python versions.
The previous error strings told users to install `opentele`, which is unmaintained and breaks on Python 3.13. Update them to reference `opentele2` (the maintained fork) and the matching `tgconvertor[tdata]` extra already declared in pyproject.toml.
🧪 Maintainer action requested — please don't merge until verifiedHi! Opening this PR as a contributor with no push access to Why I'm asking for a holdI verified the import-level fix (the actual
…but that only proves the import path is fixed. The actual conversion logic in What I'd like a maintainer to runIn a fresh venv on Python 3.13 +
If any of those fail, this PR is unsafe to merge — please leave a review with the failure trace and I'll iterate. Side note
Thanks for reviewing 🙏 |
SINSQQ
left a comment
There was a problem hiding this comment.
🔍 Self-review note — please verify on a real tdata folder
Single-line summary of what changed and what still needs verification by a maintainer:
- tdata.py L6–7: import path swap (
opentele→opentele2) — verified at import-time only. - pyproject.toml: dep swap with
>=1.2.1pin. - manager.py: error string updates only.
I do not have access to a real tdata folder, so I cannot validate the full conversion path. Please run a round-trip smoke test on Python 3.13 before merging.
|
|
||
| from opentele.td import TDesktop, Account, AuthKeyType, AuthKey # type: ignore | ||
| from opentele.td.configs import DcId # type: ignore | ||
| from opentele2.td import TDesktop, Account, AuthKeyType, AuthKey # type: ignore |
There was a problem hiding this comment.
TDesktop(basePath=...), client.mainAccount, account.authKey.key, account.UserId, account.MainDcId, _TDesktop__generateLocalKey(), Account(owner=client, api=self.api), _setMtpAuthorizationCustom, _addSingleAccount, and SaveTData(path / "tdata") has not been exercised against a real tdata folder.
Please run a Python 3.13 round-trip (from_tdata → to_folder → from_tdata) on a real sample before merging. If opentele2 renamed or shifted any of those attribute/method names, this is where it would surface.
`opentele` is no longer maintained and raises `BaseException: err` on Python 3.13 from its module-level `__new__`, breaking the `tdata` extra on import. `opentele2` is the maintained drop-in fork that ships Python 3.13 wheels starting with `1.2.1`. - Update `[tdata]` extra from `opentele` -> `opentele2>=1.2.1` - Pin to the first release with Python 3.13 wheels
`opentele` is unmaintained and breaks on Python 3.13 with `BaseException: err` raised at module import time. `opentele2` exposes the same public surface (`opentele2.td.TDesktop`, `Account`, `AuthKeyType`, `AuthKey`, `opentele2.td.configs.DcId`) and ships wheels for Python 3.13. No behavioral change beyond the import path — class names, method names and signatures are unchanged.
Summary
Replaces the unmaintained
openteledependency withopentele2(its maintained drop-in fork) so TDATA conversion works again on Python 3.13.Root cause
On Python 3.13, importing
openteleraises a hard-codedBaseException("err")insideopentele.utils.__new__, which fires during module import — so evenfrom TGConvertor import SessionManagerblows up before any code runs. Confirmed on the currentmaster:opentele2is the maintained fork. It exposes the same public surface this package relies on (opentele.td.TDesktop,Account,AuthKeyType,AuthKey,opentele.td.configs.DcId) — verified locally on Python 3.13.Changes
TGConvertor/sessions/tdata.pyfrom opentele.td ...→from opentele2.td ...(andopentele2.td.configs)TGConvertor/manager.pyopentele2instead ofopentelepyproject.toml[tdata]extra:opentele→opentele2>=1.2.1(first release with Python 3.13 wheels)Compatibility notes
opentele2is a drop-in replacement at the import-path level — same class names, same method signatures used here.TGConvertoritself.Testing done
pip install opentele2succeeds on Python 3.13.13.from opentele2.td import TDesktop, Account, AuthKeyType, AuthKeyandfrom opentele2.td.configs import DcIdimport cleanly.DcId(2),AuthKeyType.ReadFromFile, andAuthKey(bytes, ...)construct as expected.A full round-trip conversion test (tdata ↔ pyrogram/telethon) needs a real
tdatafolder, which I don't have handy — would appreciate a maintainer running that as part of review before merging.Could a maintainer:
opentele2installed.tdatafolder → telethon file, and a telethon file →tdatafolder.auth_key/dc_id/user_id.If anything regresses, I'd rather hear about it before merge than after a release ships.
Closes the import error traced at
TGConvertor/sessions/tdata.py#L6in the linked issue.