Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-librouteros for openSUSE:Factory checked in at 2026-09-08 16:58:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-librouteros (Old) and /work/SRC/openSUSE:Factory/.python-librouteros.new.1265 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-librouteros" Tue Sep 8 16:58:05 2026 rev:16 rq:1376292 version:4.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-librouteros/python-librouteros.changes 2026-08-22 21:37:51.836909940 +0200 +++ /work/SRC/openSUSE:Factory/.python-librouteros.new.1265/python-librouteros.changes 2026-09-08 17:01:30.364468199 +0200 @@ -1,0 +2,6 @@ +Tue Sep 8 06:12:39 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 4.2.1 + * Prevent AsyncApiProtocol.close() from hanging. + +------------------------------------------------------------------- Old: ---- librouteros-4.2.0.tar.gz New: ---- librouteros-4.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-librouteros.spec ++++++ --- /var/tmp/diff_new_pack.d6mCBB/_old 2026-09-08 17:01:31.189502684 +0200 +++ /var/tmp/diff_new_pack.d6mCBB/_new 2026-09-08 17:01:31.196502977 +0200 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} Name: python-librouteros -Version: 4.2.0 +Version: 4.2.1 Release: 0 Summary: Python implementation of MikroTik RouterOS API License: GPL-2.0-or-later ++++++ librouteros-4.2.0.tar.gz -> librouteros-4.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-4.2.0/CHANGELOG.rst new/librouteros-4.2.1/CHANGELOG.rst --- old/librouteros-4.2.0/CHANGELOG.rst 2026-08-19 13:30:13.000000000 +0200 +++ new/librouteros-4.2.1/CHANGELOG.rst 2026-09-07 21:28:11.000000000 +0200 @@ -1,3 +1,8 @@ +4.2.1 +----- + +* Prevent ``AsyncApiProtocol.close()`` from hanging. + 4.2.0 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-4.2.0/pyproject.toml new/librouteros-4.2.1/pyproject.toml --- old/librouteros-4.2.0/pyproject.toml 2026-08-19 13:30:13.000000000 +0200 +++ new/librouteros-4.2.1/pyproject.toml 2026-09-07 21:28:11.000000000 +0200 @@ -1,6 +1,6 @@ [project] name = "librouteros" -version = "4.2.0" +version = "4.2.1" description = "Python implementation of MikroTik RouterOS API" authors = [ { name = "Ćukasz Kostka", email = "[email protected]" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-4.2.0/src/librouteros/protocol.py new/librouteros-4.2.1/src/librouteros/protocol.py --- old/librouteros-4.2.0/src/librouteros/protocol.py 2026-08-19 13:30:13.000000000 +0200 +++ new/librouteros-4.2.1/src/librouteros/protocol.py 2026-09-07 21:28:11.000000000 +0200 @@ -250,4 +250,5 @@ return word.decode(encoding=self.encoding, errors="ignore") async def close(self) -> None: - await self.transport.close() + # Timeout guard so an unresponsive peer cannot make close() hang + await asyncio.wait_for(self.transport.close(), self.timeout) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-4.2.0/tests/unit/test_protocol.py new/librouteros-4.2.1/tests/unit/test_protocol.py --- old/librouteros-4.2.0/tests/unit/test_protocol.py 2026-08-19 13:30:13.000000000 +0200 +++ new/librouteros-4.2.1/tests/unit/test_protocol.py 2026-09-07 21:28:11.000000000 +0200 @@ -1,5 +1,6 @@ # -*- coding: UTF-8 -*- +import asyncio from unittest.mock import MagicMock, patch import pytest @@ -166,3 +167,15 @@ # async await self.async_protocol.close() self.async_protocol.transport.close.assert_called_once_with() + + @pytest.mark.asyncio + async def test_async_close_times_out_on_hung_teardown(self): + """A hung teardown must not block forever - wait_for raises TimeoutError.""" + + async def hang(): + await asyncio.sleep(3600) + + self.async_protocol.timeout = 0.01 + self.async_protocol.transport.close.side_effect = hang + with pytest.raises(asyncio.TimeoutError): + await self.async_protocol.close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-4.2.0/uv.lock new/librouteros-4.2.1/uv.lock --- old/librouteros-4.2.0/uv.lock 2026-08-19 13:30:13.000000000 +0200 +++ new/librouteros-4.2.1/uv.lock 2026-09-07 21:28:11.000000000 +0200 @@ -418,7 +418,7 @@ [[package]] name = "librouteros" -version = "4.2.0" +version = "4.2.1" source = { editable = "." } [package.dev-dependencies]
