Public bug reported:

fastapi currently FTBFS on Ubuntu Oracular due to an incompatibility
between anyio 4.4.0 and starlett:

_____________________________ test_sync_context_b
______________________________

cls = <class '_pytest.runner.CallInfo'>
func = <function call_and_report.<locals>.<lambda> at 0x7f763f8ac540>
when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: type[BaseException] | tuple[type[BaseException], ...] | None = 
None,
    ) -> CallInfo[TResult]:
        """Call func, wrapping the result in a CallInfo.
    
        :param func:
            The function to call. Called without arguments.
        :type func: Callable[[], _pytest.runner.TResult]
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: TResult | None = func()

/usr/lib/python3/dist-packages/_pytest/runner.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3/dist-packages/_pytest/runner.py:242: in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
/usr/lib/python3/dist-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, 
firstresult)
/usr/lib/python3/dist-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/usr/lib/python3/dist-packages/_pytest/threadexception.py:92: in 
pytest_runtest_call
    yield from thread_exception_runtest_hook()
/usr/lib/python3/dist-packages/_pytest/threadexception.py:68: in 
thread_exception_runtest_hook
    yield
/usr/lib/python3/dist-packages/_pytest/unraisableexception.py:95: in 
pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
        with catch_unraisable_exception() as cm:
            try:
                yield
            finally:
                if cm.unraisable:
                    if cm.unraisable.err_msg is not None:
                        err_msg = cm.unraisable.err_msg
                    else:
                        err_msg = "Exception ignored in"
                    msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
                    msg += "".join(
                        traceback.format_exception(
                            cm.unraisable.exc_type,
                            cm.unraisable.exc_value,
                            cm.unraisable.exc_traceback,
                        )
                    )
>                   warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E                   pytest.PytestUnraisableExceptionWarning: Exception ignored 
in: <function MemoryObjectReceiveStream.__del__ at 0x7f7642916a20>
E                   
E                   Traceback (most recent call last):
E                     File 
"/usr/lib/python3/dist-packages/anyio/streams/memory.py", line 177, in __del__
E                       warnings.warn(
E                   ResourceWarning: Unclosed <MemoryObjectReceiveStream>

This is a discussion on the upstream starlette project:

https://github.com/encode/starlette/discussions/2603

and a RC bug in Debian as well:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1073445

** Affects: fastapi (Ubuntu)
     Importance: High
         Status: Triaged

** Affects: python-anyio (Ubuntu)
     Importance: High
         Status: Triaged

** Affects: starlette (Ubuntu)
     Importance: High
         Status: Triaged

** Affects: fastapi (Ubuntu Oracular)
     Importance: High
         Status: Triaged

** Affects: python-anyio (Ubuntu Oracular)
     Importance: High
         Status: Triaged

** Affects: starlette (Ubuntu Oracular)
     Importance: High
         Status: Triaged


** Tags: ftbfs

** Also affects: python-anyio (Ubuntu)
   Importance: Undecided
       Status: New

** Also affects: starlette (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2080016

Title:
  fastapi FTBFS on oracular due to failing tests - ResourceWarning:
  Unclosed <MemoryObjectReceiveStream>

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fastapi/+bug/2080016/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to