#1139416 python-unifi-discovery: FTBFS with aiohttp 3.14

#1139416#5
Date:
2026-06-08 23:14:54 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202606/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:python-unifi-discovery, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
 debian/rules clean
make: pyversions: No such file or directory
py3versions: no X-Python3-Version in control file, using supported versions
dh clean --buildsystem=pybuild --with python3
   dh_auto_clean -O--buildsystem=pybuild
   dh_autoreconf_clean -O--buildsystem=pybuild
   dh_clean -O--buildsystem=pybuild
 debian/rules binary
make: pyversions: No such file or directory
py3versions: no X-Python3-Version in control file, using supported versions
dh binary --buildsystem=pybuild --with python3
   dh_update_autotools_config -O--buildsystem=pybuild
   dh_autoreconf -O--buildsystem=pybuild
   dh_auto_configure -O--buildsystem=pybuild
   dh_auto_build -O--buildsystem=pybuild
I: pybuild plugin_pyproject:142: Building wheel for python3.14 with "build" module
I: pybuild base:385: python3.14 -m build --skip-dependency-check --no-isolation --wheel --outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14
* Building wheel...
The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
Successfully built unifi_discovery-1.2.0-py3-none-any.whl
I: pybuild plugin_pyproject:168: Unpacking wheel built for python3.14 with "installer" module
I: pybuild plugin_pyproject:142: Building wheel for python3.13 with "build" module
I: pybuild base:385: python3.13 -m build --skip-dependency-check --no-isolation --wheel --outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13
* Building wheel...
The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
Successfully built unifi_discovery-1.2.0-py3-none-any.whl
I: pybuild plugin_pyproject:168: Unpacking wheel built for python3.13 with "installer" module
   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:385: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14/build; python3.14 -m pytest -v tests -k 'not test_async_scanner_specific_address and not test_async_scanner_broadcast and not test_async_scanner_no_system_response and not test_async_scanner_system_api_missing_mac and not test_async_scanner_system_api_returns_html'
============================= test session starts ==============================
platform linux -- Python 3.14.5, pytest-9.0.3, pluggy-1.6.0 -- /usr/bin/python3.14
cachedir: .pytest_cache
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14/build
configfile: pyproject.toml
plugins: asyncio-1.4.0, cov-5.0.0, typeguard-4.4.4
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... collected 7 items / 5 deselected / 2 selected

tests/test_init.py::test_async_scanner_falls_back_to_any_source_port_if_socket_in_use PASSED [ 50%]
tests/test_init.py::test_async_console_is_alive FAILED                   [100%]

=================================== FAILURES ===================================

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_init.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
unifi_discovery/__init__.py:147: in async_console_is_alive
    await session.get(
<string>:3: in _request
    ???
/usr/lib/python3.14/unittest/mock.py:2344: in _execute_mock_call
    result = await effect(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:512: in _request_mock
    response = await self.match(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:456: in match
    response_or_exc = await matcher.build_response(
/usr/lib/python3/dist-packages/aioresponses/core.py:202: in build_response
    resp = self._build_response(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <aioresponses.core.RequestMatch object at 0x7f8f3b49b4d0>
url = URL('https://1.2.3.1/api/system'), method = 'get', request_headers = {}
status = 401, body = b'', content_type = 'application/json', payload = None
headers = None, response_class = <class 'aiohttp.client_reqrep.ClientResponse'>
reason = 'Unauthorized'

    def _build_response(self, url: 'Union[URL, str]',
                        method: str = hdrs.METH_GET,
                        request_headers: Optional[Dict] = None,
                        status: int = 200,
                        body: Union[str, bytes] = '',
                        content_type: str = 'application/json',
                        payload: Optional[Dict] = None,
                        headers: Optional[Dict] = None,
                        response_class: Optional[Type[ClientResponse]] = None,
                        reason: Optional[str] = None) -> ClientResponse:
        if response_class is None:
            response_class = ClientResponse
        if payload is not None:
            body = json.dumps(payload)
        if not isinstance(body, bytes):
            body = str.encode(body)
        if request_headers is None:
            request_headers = {}
        loop = Mock()
        loop.get_debug = Mock()
        loop.get_debug.return_value = True
        kwargs = {}  # type: Dict[str, Any]
        kwargs['request_info'] = RequestInfo(
            url=url,
            method=method,
            headers=CIMultiDictProxy(CIMultiDict(**request_headers)),
        )
        kwargs['writer'] = None
        kwargs['continue100'] = None
        kwargs['timer'] = TimerNoop()
        kwargs['traces'] = []
        kwargs['loop'] = loop
        kwargs['session'] = None

        # We need to initialize headers manually
        _headers = CIMultiDict({hdrs.CONTENT_TYPE: content_type})
        if headers:
            _headers.update(headers)
        raw_headers = self._build_raw_headers(_headers)
/usr/lib/python3/dist-packages/aioresponses/core.py:171: TypeError
=============================== warnings summary ===============================
tests/test_init.py::test_async_scanner_falls_back_to_any_source_port_if_socket_in_use
  /usr/lib/python3.14/asyncio/events.py:94: ResourceWarning: unclosed <socket.socket fd=15, family=2, type=2, proto=0, laddr=('0.0.0.0', 10001)>
    self._context.run(self._callback, *self._args)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_init.py::test_async_scanner_falls_back_to_any_source_port_if_socket_in_use
  /usr/lib/python3.14/asyncio/events.py:94: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=2, proto=0, laddr=('0.0.0.0', 10001)>
    self._context.run(self._callback, *self._args)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
---------- coverage: platform linux, python 3.14.5-final-0 -----------
Name                          Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------------
unifi_discovery/__init__.py     288    196     72      1    26%   26, 69, 73, 77, 82-93, 117, 151-152, 157-169, 173-179, 186-221, 232-234, 245-247, 251, 255, 266-267, 271-277, 281-288, 292-321, 325-341, 348-349, 352-354, 367-373, 383-409, 415-421, 431-434, 440-479, 494-525
-------------------------------------------------------------------------
TOTAL                           288    196     72      1    26%

=========================== short test summary info ============================
FAILED tests/test_init.py::test_async_console_is_alive - TypeError: ClientResponse.__init__() missing 1 required keyword-only argument: 'stream_writer'
============ 1 failed, 1 passed, 5 deselected, 2 warnings in 0.24s =============
E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14/build; python3.14 -m pytest -v tests -k 'not test_async_scanner_specific_address and not test_async_scanner_broadcast and not test_async_scanner_no_system_response and not test_async_scanner_system_api_missing_mac and not test_async_scanner_system_api_returns_html'
I: pybuild base:385: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m pytest -v tests -k 'not test_async_scanner_specific_address and not test_async_scanner_broadcast and not test_async_scanner_no_system_response and not test_async_scanner_system_api_missing_mac and not test_async_scanner_system_api_returns_html'
============================= test session starts ==============================
platform linux -- Python 3.13.12, pytest-9.0.3, pluggy-1.6.0 -- /usr/bin/python3.13
cachedir: .pytest_cache
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build
configfile: pyproject.toml
plugins: asyncio-1.4.0, cov-5.0.0, typeguard-4.4.4
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... collected 7 items / 5 deselected / 2 selected

tests/test_init.py::test_async_scanner_falls_back_to_any_source_port_if_socket_in_use PASSED [ 50%]
tests/test_init.py::test_async_console_is_alive FAILED                   [100%]

=================================== FAILURES ===================================

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_init.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
unifi_discovery/__init__.py:147: in async_console_is_alive
    await session.get(
<string>:3: in _request
    ???
/usr/lib/python3.13/unittest/mock.py:2332: in _execute_mock_call
    result = await effect(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:512: in _request_mock
    response = await self.match(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/aioresponses/core.py:456: in match
    response_or_exc = await matcher.build_response(
/usr/lib/python3/dist-packages/aioresponses/core.py:202: in build_response
    resp = self._build_response(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <aioresponses.core.RequestMatch object at 0x7fe4ffba42f0>
url = URL('https://1.2.3.1/api/system'), method = 'get', request_headers = {}
status = 401, body = b'', content_type = 'application/json', payload = None
headers = None, response_class = <class 'aiohttp.client_reqrep.ClientResponse'>
reason = 'Unauthorized'

    def _build_response(self, url: 'Union[URL, str]',
                        method: str = hdrs.METH_GET,
                        request_headers: Optional[Dict] = None,
                        status: int = 200,
                        body: Union[str, bytes] = '',
                        content_type: str = 'application/json',
                        payload: Optional[Dict] = None,
                        headers: Optional[Dict] = None,
                        response_class: Optional[Type[ClientResponse]] = None,
                        reason: Optional[str] = None) -> ClientResponse:
        if response_class is None:
            response_class = ClientResponse
        if payload is not None:
            body = json.dumps(payload)
        if not isinstance(body, bytes):
            body = str.encode(body)
        if request_headers is None:
            request_headers = {}
        loop = Mock()
        loop.get_debug = Mock()
        loop.get_debug.return_value = True
        kwargs = {}  # type: Dict[str, Any]
        kwargs['request_info'] = RequestInfo(
            url=url,
            method=method,
            headers=CIMultiDictProxy(CIMultiDict(**request_headers)),
        )
        kwargs['writer'] = None
        kwargs['continue100'] = None
        kwargs['timer'] = TimerNoop()
        kwargs['traces'] = []
        kwargs['loop'] = loop
        kwargs['session'] = None

        # We need to initialize headers manually
        _headers = CIMultiDict({hdrs.CONTENT_TYPE: content_type})
        if headers:
            _headers.update(headers)
        raw_headers = self._build_raw_headers(_headers)
/usr/lib/python3/dist-packages/aioresponses/core.py:171: TypeError
=============================== warnings summary ===============================
tests/test_init.py::test_async_scanner_falls_back_to_any_source_port_if_socket_in_use
  /usr/lib/python3.13/asyncio/events.py:89: ResourceWarning: unclosed <socket.socket fd=14, family=2, type=2, proto=0, laddr=('0.0.0.0', 10001)>
    self._context.run(self._callback, *self._args)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/test_init.py::test_async_scanner_falls_back_to_any_source_port_if_socket_in_use
  /usr/lib/python3.13/asyncio/events.py:89: ResourceWarning: unclosed <socket.socket fd=15, family=2, type=2, proto=0, laddr=('0.0.0.0', 10001)>
    self._context.run(self._callback, *self._args)
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
---------- coverage: platform linux, python 3.13.12-final-0 ----------
Name                          Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------------
unifi_discovery/__init__.py     288    196     72      1    26%   26, 69, 73, 77, 82-93, 117, 151-152, 157-169, 173-179, 186-221, 232-234, 245-247, 251, 255, 266-267, 271-277, 281-288, 292-321, 325-341, 348-349, 352-354, 367-373, 383-409, 415-421, 431-434, 440-479, 494-525
-------------------------------------------------------------------------
TOTAL                           288    196     72      1    26%

=========================== short test summary info ============================
FAILED tests/test_init.py::test_async_console_is_alive - TypeError: ClientResponse.__init__() missing 1 required keyword-only argument: 'stream_writer'
============ 1 failed, 1 passed, 5 deselected, 2 warnings in 0.23s =============
E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m pytest -v tests -k 'not test_async_scanner_specific_address and not test_async_scanner_broadcast and not test_async_scanner_no_system_response and not test_async_scanner_system_api_missing_mac and not test_async_scanner_system_api_returns_html'
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.14 3.13" --parallel=2 returned exit code 13
make: *** [debian/rules:9: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------