fix(telegram): catch AttributeError from PTB python-3.11 __slots__ conflict with actionable message - #64773
Conversation
…nflict with actionable message
|
Closing as redundant — this bug was already fixed on main in PR #64574 (commit f5f79ff, merged ~1 hour before this PR opened). The The fix in #64574 replaced the instance assignment with a Thanks for the contribution @kyssta-exe — the error message you wrote would have been helpful for users hitting this before the fix landed. The underlying issue (#64482 / #64730) is resolved. |
Fixes #64730
Summary
On Python 3.11, a CPython interaction between
abc.abstractmethodand__slots__in PTB'sHTTPXRequestclass makes thedo_requestattribute read-only. When the Telegram adapter'sconnect()callsApplication.initialize(), the abstract-method/slots conflict raises:This is a closed issue in CPython resolved in Python 3.12+, but users on Python 3.11 (especially Windows) hit it when running the Telegram gateway.
Fix
Convert the opaque
AttributeErrorinto a clearOSErrorwith an actionable message suggesting:==22.6) is installedTest Plan
test_telegram_start_polling_timeout.py: 4/4 passedtest_telegram_init_deadline.py: 6/6 passedtest_telegram_closewait_limits_31599.py+test_telegram_conflict.py+test_telegram_network.py: 63/63 passed