Source: python-telethon Version: 1.25.1-1 Severity: normal User: debian-pyt...@lists.debian.org Usertags: python3.13 Tags: upstream patch Forwarded: https://github.com/LonamiWebs/Telethon/issues/4207
This package failed build from source when test-built against a version of python3-defaults that incudes 3.13 as a supported version. To reproduce this issue, build against python3-defaults (python3-all-dev etc.) from Debian experimental. What's new in Python 3.13: https://docs.python.org/3.13/whatsnew/3.13.html imghdr was removed. Looks like python-telethon has cut (several) new releases including a fix for this. Log snippet: from .telegrambaseclient import TelegramBaseClient telethon/client/telegrambaseclient.py:13: in <module> from ..entitycache import EntityCache telethon/entitycache.py:4: in <module> from . import utils telethon/utils.py:7: in <module> import imghdr E ModuleNotFoundError: No module named 'imghdr' ___________ ERROR collecting tests/telethon/client/test_messages.py ____________ ImportError while importing test module '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/telethon/client/test_messages.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.13/importlib/__init__.py:88: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/telethon/client/test_messages.py:5: in <module> from telethon import TelegramClient telethon/__init__.py:1: in <module> from .client.telegramclient import TelegramClient telethon/client/__init__.py:12: in <module> from .telegrambaseclient import TelegramBaseClient telethon/client/telegrambaseclient.py:13: in <module> from ..entitycache import EntityCache telethon/entitycache.py:4: in <module> from . import utils telethon/utils.py:7: in <module> import imghdr E ModuleNotFoundError: No module named 'imghdr' __________ ERROR collecting tests/telethon/events/test_chataction.py ___________ ImportError while importing test module '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/telethon/events/test_chataction.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.13/importlib/__init__.py:88: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/telethon/events/test_chataction.py:3: in <module> from telethon import TelegramClient, events, types, utils telethon/__init__.py:1: in <module> from .client.telegramclient import TelegramClient telethon/client/__init__.py:12: in <module> from .telegrambaseclient import TelegramBaseClient telethon/client/telegrambaseclient.py:13: in <module> from ..entitycache import EntityCache telethon/entitycache.py:4: in <module> from . import utils telethon/utils.py:7: in <module> import imghdr E ModuleNotFoundError: No module named 'imghdr' ___________ ERROR collecting tests/telethon/extensions/test_html.py ____________ ImportError while importing test module '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/telethon/extensions/test_html.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.13/importlib/__init__.py:88: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/telethon/extensions/test_html.py:4: in <module> from telethon.extensions import html telethon/extensions/html.py:10: in <module> from .. import helpers telethon/__init__.py:1: in <module> from .client.telegramclient import TelegramClient telethon/client/__init__.py:12: in <module> from .telegrambaseclient import TelegramBaseClient telethon/client/telegrambaseclient.py:13: in <module> from ..entitycache import EntityCache telethon/entitycache.py:4: in <module> from . import utils telethon/utils.py:7: in <module> import imghdr E ModuleNotFoundError: No module named 'imghdr' _________ ERROR collecting tests/telethon/extensions/test_markdown.py __________ ImportError while importing test module '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/telethon/extensions/test_markdown.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.13/importlib/__init__.py:88: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/telethon/extensions/test_markdown.py:4: in <module> from telethon.extensions import markdown telethon/__init__.py:1: in <module> from .client.telegramclient import TelegramClient telethon/client/__init__.py:12: in <module> from .telegrambaseclient import TelegramBaseClient telethon/client/telegrambaseclient.py:13: in <module> from ..entitycache import EntityCache telethon/entitycache.py:4: in <module> from . import utils telethon/utils.py:7: in <module> import imghdr E ModuleNotFoundError: No module named 'imghdr' _______________ ERROR collecting tests/telethon/test_helpers.py ________________ ImportError while importing test module '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/telethon/test_helpers.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.13/importlib/__init__.py:88: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/telethon/test_helpers.py:9: in <module> from telethon import helpers telethon/__init__.py:1: in <module> from .client.telegramclient import TelegramClient telethon/client/__init__.py:12: in <module> from .telegrambaseclient import TelegramBaseClient telethon/client/telegrambaseclient.py:13: in <module> from ..entitycache import EntityCache telethon/entitycache.py:4: in <module> from . import utils telethon/utils.py:7: in <module> import imghdr E ModuleNotFoundError: No module named 'imghdr' ________________ ERROR collecting tests/telethon/test_utils.py _________________ ImportError while importing test module '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/telethon/test_utils.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.13/importlib/__init__.py:88: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/telethon/test_utils.py:6: in <module> from telethon import utils telethon/__init__.py:1: in <module> from .client.telegramclient import TelegramClient telethon/client/__init__.py:12: in <module> from .telegrambaseclient import TelegramBaseClient telethon/client/telegrambaseclient.py:13: in <module> from ..entitycache import EntityCache telethon/entitycache.py:4: in <module> from . import utils telethon/utils.py:7: in <module> import imghdr E ModuleNotFoundError: No module named 'imghdr' =========================== short test summary info ============================ ERROR tests/readthedocs/quick_references/test_client_reference.py ERROR tests/telethon/client/test_messages.py ERROR tests/telethon/events/test_chataction.py ERROR tests/telethon/extensions/test_html.py ERROR tests/telethon/extensions/test_markdown.py ERROR tests/telethon/test_helpers.py ERROR tests/telethon/test_utils.py !!!!!!!!!!!!!!!!!!! Interrupted: 7 errors during collection !!!!!!!!!!!!!!!!!!!! ============================== 7 errors in 1.06s =============================== E: pybuild pybuild:389: test: plugin distutils failed with: exit code=2: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m pytest tests I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build; python3.12 -m pytest tests ============================= test session starts ============================== platform linux -- Python 3.12.6, pytest-8.3.2, pluggy-1.5.0 rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build configfile: pyproject.toml plugins: typeguard-4.3.0, cov-5.0.0, asyncio-0.20.3 asyncio: mode=Mode.STRICT collected 31 items tests/readthedocs/quick_references/test_client_reference.py . [ 3%] tests/telethon/client/test_messages.py . [ 6%] tests/telethon/crypto/test_rsa.py .... [ 19%] tests/telethon/events/test_chataction.py .... [ 32%] tests/telethon/extensions/test_html.py ..... [ 48%] tests/telethon/extensions/test_markdown.py ..... [ 64%] tests/telethon/test_helpers.py .... [ 77%] tests/telethon/test_pickle.py .... [ 90%] tests/telethon/test_utils.py .. [ 96%] tests/telethon/tl/test_serialization.py . [100%] =============================== warnings summary =============================== telethon/utils.py:7 /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/telethon/utils.py:7: DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13 import imghdr -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 31 passed, 1 warning in 0.91s ========================= dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.13 3.12" returned exit code 13 make: *** [debian/rules:10: build] Error 25 dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 -------------------------------------------------------------------------------- Build finished at 2024-09-11T15:46:44Z If required, the full build log is available here (for the next 30 days): https://debusine.debian.net/artifact/701521/ This bug has been filed at "normal" severity, as we haven't started the transition to add 3.13 as a supported version, yet. This will be raised to RC as soon as that happens, hopefully well before trixie. Thanks, Stefano