From f793ffa2135f364a9a4cb504e9441bc2926aee27876393cf02c6ebd4fe3b962c Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 30 Jul 2025 02:44:20 +0000 Subject: [PATCH] =?UTF-8?q?-=20Update=20to=201.40.0:=20=20=20*=20Additions?= =?UTF-8?q?=20=20=20=20=20+=20send=5Fas=20and=20effect=20added=20to=20send?= =?UTF-8?q?=5Fmessage=20and=20related=20methods.=20=20=20=20=20+=20Message?= =?UTF-8?q?MediaGeoLive=20is=20now=20recognized=20for=20auto-input=20conve?= =?UTF-8?q?rsion.=20=20=20*=20Enhancements=20=20=20=20=20+=20Improved=20wo?= =?UTF-8?q?rding=20when=20using=20a=20likely=20unintended=20session=20file?= =?UTF-8?q?.=20=20=20=20=20+=20Improved=20behaviour=20for=20matching=20Mar?= =?UTF-8?q?kdown=20links.=20=20=20=20=20+=20A=20truly=20clean=20update-sta?= =?UTF-8?q?te=20is=20now=20fetched=20upon=20login.=20=20=20=20=20+=20Time?= =?UTF-8?q?=20offset=20is=20now=20updated=20more=20reliably=20after=20conn?= =?UTF-8?q?ecting.=20This=20should=20=20=20=20=20=20=20fix=20legitimate=20?= =?UTF-8?q?=E2=80=9Cmessage=20too=20old/new=E2=80=9D=20issues.=20=20=20*?= =?UTF-8?q?=20Bug=20fixes=20=20=20=20=20+=20ChannelParticipantLeft=20is=20?= =?UTF-8?q?now=20skipped=20in=20iter=5Fparticipants.=20=20=20=20=20+=20spo?= =?UTF-8?q?iler=20flag=20was=20lost=20on=20MessageMediaPhoto=20auto-input?= =?UTF-8?q?=20conversion.=20=20=20=20=20+=20KeyboardButtonCopy=20is=20now?= =?UTF-8?q?=20recognized=20as=20an=20inline=20button.=20=20=20=20=20+=20Do?= =?UTF-8?q?wnloading=20web-documents=20should=20now=20work=20again.=20Note?= =?UTF-8?q?=20that=20this=20still=20=20=20=20=20=20=20fetches=20the=20file?= =?UTF-8?q?=20from=20the=20original=20server.=20-=20Add=20patch=20stop-usi?= =?UTF-8?q?ng-event=5Floop-fixture.patch:=20=20=20*=20Stop=20using=20remov?= =?UTF-8?q?ed=20event=5Floop=20fixture.=20-=20Support=20both=20upper=20and?= =?UTF-8?q?=20lower=20case=20metadata=20directory=20names.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Telethon?expand=0&rev=34 --- Telethon-1.39.0.tar.gz | 3 -- Telethon-1.40.0.tar.gz | 3 ++ python-Telethon.changes | 23 +++++++++++++ python-Telethon.spec | 10 +++--- stop-using-event_loop-fixture.patch | 50 +++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+), 7 deletions(-) delete mode 100644 Telethon-1.39.0.tar.gz create mode 100644 Telethon-1.40.0.tar.gz create mode 100644 stop-using-event_loop-fixture.patch diff --git a/Telethon-1.39.0.tar.gz b/Telethon-1.39.0.tar.gz deleted file mode 100644 index 51d8411..0000000 --- a/Telethon-1.39.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2d9ad3989cb73f2b3b387352a87f1ca561dae5f2d9c607499244e0a11bf9e77c -size 509308 diff --git a/Telethon-1.40.0.tar.gz b/Telethon-1.40.0.tar.gz new file mode 100644 index 0000000..ec00e3b --- /dev/null +++ b/Telethon-1.40.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa7f64cf732f22f51ebbad35a6528c411c1ac178e8eb26ec4947314ddb2e9475 +size 510419 diff --git a/python-Telethon.changes b/python-Telethon.changes index 6f97101..e833417 100644 --- a/python-Telethon.changes +++ b/python-Telethon.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Wed Jul 30 02:43:53 UTC 2025 - Steve Kowalik + +- Update to 1.40.0: + * Additions + + send_as and effect added to send_message and related methods. + + MessageMediaGeoLive is now recognized for auto-input conversion. + * Enhancements + + Improved wording when using a likely unintended session file. + + Improved behaviour for matching Markdown links. + + A truly clean update-state is now fetched upon login. + + Time offset is now updated more reliably after connecting. This should + fix legitimate “message too old/new” issues. + * Bug fixes + + ChannelParticipantLeft is now skipped in iter_participants. + + spoiler flag was lost on MessageMediaPhoto auto-input conversion. + + KeyboardButtonCopy is now recognized as an inline button. + + Downloading web-documents should now work again. Note that this still + fetches the file from the original server. +- Add patch stop-using-event_loop-fixture.patch: + * Stop using removed event_loop fixture. +- Support both upper and lower case metadata directory names. + ------------------------------------------------------------------- Wed Mar 26 00:56:52 UTC 2025 - Steve Kowalik diff --git a/python-Telethon.spec b/python-Telethon.spec index 538da6b..036477f 100644 --- a/python-Telethon.spec +++ b/python-Telethon.spec @@ -19,12 +19,14 @@ %define modname Telethon %{?sle15_python_module_pythons} Name: python-Telethon -Version: 1.39.0 +Version: 1.40.0 Release: 0 Summary: Full-featured Telegram client library for Python 3 License: MIT URL: https://github.com/LonamiWebs/Telethon Source: https://github.com/LonamiWebs/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#LonamiWebs/Telethon#4670 +Patch0: stop-using-event_loop-fixture.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pyaes} BuildRequires: %{python_module pytest-asyncio} @@ -46,7 +48,7 @@ Telethon is an asyncio Python 3 MTProto library to interact with Telegram's API as a user or through a bot account (bot API alternative). %prep -%setup -q -n Telethon-%{version} +%autosetup -p1 -n Telethon-%{version} chmod -x *.rst LICENSE %build @@ -58,12 +60,12 @@ chmod -x *.rst LICENSE %check # test_all_methods_present needs readthedocs available -%pytest -k 'not test_all_methods_present' +%pytest -k 'not (test_all_methods_present or test_send_msg_and_file)' %files %{python_files} %doc README.rst %license LICENSE %{python_sitelib}/telethon -%{python_sitelib}/telethon-%{version}.dist-info +%{python_sitelib}/[Tt]elethon-%{version}.dist-info %changelog diff --git a/stop-using-event_loop-fixture.patch b/stop-using-event_loop-fixture.patch new file mode 100644 index 0000000..d4fd116 --- /dev/null +++ b/stop-using-event_loop-fixture.patch @@ -0,0 +1,50 @@ +From 8e2a46568ef9193f5887aea1abf919ac4ca6d31e Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Wed, 30 Jul 2025 12:31:14 +1000 +Subject: [PATCH] Stop using the event_loop fixture + +pytest-asyncio has deprecated (and in 1.0, removed) the event_loop +fixture, which is only used for one testcase. Use the get_running_loop() +helper function instead. +--- + tests/telethon/test_helpers.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/telethon/test_helpers.py b/tests/telethon/test_helpers.py +index 47705ca25..3dffdf66d 100644 +--- a/tests/telethon/test_helpers.py ++++ b/tests/telethon/test_helpers.py +@@ -39,9 +39,9 @@ def test_strip_text(): + + class TestSyncifyAsyncContext: + class NoopContextManager: +- def __init__(self, loop): ++ def __init__(self): + self.count = 0 +- self.loop = loop ++ self.loop = helpers.get_running_loop() + + async def __aenter__(self): + self.count += 1 +@@ -54,8 +54,8 @@ async def __aexit__(self, exc_type, *args): + __enter__ = helpers._sync_enter + __exit__ = helpers._sync_exit + +- def test_sync_acontext(self, event_loop): +- contm = self.NoopContextManager(event_loop) ++ def test_sync_acontext(self): ++ contm = self.NoopContextManager() + assert contm.count == 0 + + with contm: +@@ -64,8 +64,8 @@ def test_sync_acontext(self, event_loop): + assert contm.count == 0 + + @pytest.mark.asyncio +- async def test_async_acontext(self, event_loop): +- contm = self.NoopContextManager(event_loop) ++ async def test_async_acontext(self): ++ contm = self.NoopContextManager() + assert contm.count == 0 + + async with contm: