Skip to content

uvloop fails on 3.14 #637

Description

@graingert
ImportError while loading conftest '/home/runner/work/anyio/anyio/tests/conftest.py'.
tests/conftest.py:17: in <module>
    import uvloop
/opt/hostedtoolcache/Python/3.14.0-alpha.1/x64/lib/python3.14/site-packages/uvloop/__init__.py:9: in <module>
    from .loop import Loop as __BaseLoop  # NOQA
uvloop/includes/stdlib.pxi:47: in init uvloop.loop
    ???
E   AttributeError: module 'asyncio' has no attribute 'AbstractChildWatcher'

Activity

  1. fantix commented on Oct 21, 2024

    @fantix
    Member

    Ah, this has been deprecated since Python 3.12 and will be removed in 3.14. Let's get rid of it in uvloop too.

  2. befeleme commented on Mar 12, 2025

    @befeleme
    Contributor

    With Python 3.14.0a5 there's one more thing happening:

    ________________ ERROR collecting _empty/tests/test_aiohttp.py _________________
    ImportError while importing test module '/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_aiohttp.py'.
    Hint: make sure your test modules/packages have valid Python names.
    Traceback:
    tests/test_aiohttp.py:14: in <module>
        from uvloop import _testbase as tb
    ../../BUILDROOT/usr/lib64/python3.14/site-packages/uvloop/__init__.py:6: in <module>
        from asyncio.events import BaseDefaultEventLoopPolicy as __BasePolicy
    E   ImportError: cannot import name 'BaseDefaultEventLoopPolicy' from 'asyncio.events' (/usr/lib64/python3.14/asyncio/events.py)
    
  3. hroncok commented on Mar 12, 2025

    @hroncok
    Contributor
    ImportError: cannot import name 'BaseDefaultEventLoopPolicy' from 'asyncio.events'
    

    I reported that part as python/cpython#131148

  4. hroncok commented on Mar 12, 2025

    @hroncok
    Contributor

    I attempted to do something in #658, but it doesn't work correctly.

    I still get:

    =================================== FAILURES ===================================
    ________________________ TestBaseAIO.test_set_task_name ________________________
    Traceback (most recent call last):
      File "/usr/lib64/python3.14/unittest/case.py", line 58, in testPartExecutor
        yield
      File "/usr/lib64/python3.14/unittest/case.py", line 660, in run
        self._callTestMethod(testMethod)
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/usr/lib64/python3.14/unittest/case.py", line 606, in _callTestMethod
        result = method()
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_base.py", line 594, in test_set_task_name
        self.assertEqual(result, "mytask!")
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.14/unittest/case.py", line 916, in assertEqual
        assertion_func(first, second, msg=msg)
        ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.14/unittest/case.py", line 909, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: None != 'mytask!'
    ________________ TestUVExecutors.test_executors_process_pool_01 ________________
    Traceback (most recent call last):
      File "/usr/lib64/python3.14/unittest/case.py", line 58, in testPartExecutor
        yield
      File "/usr/lib64/python3.14/unittest/case.py", line 660, in run
        self._callTestMethod(testMethod)
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/usr/lib64/python3.14/unittest/case.py", line 606, in _callTestMethod
        result = method()
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_executors.py", line 35, in test_executors_process_pool_01
        self.run_pool_test(concurrent.futures.ProcessPoolExecutor)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_executors.py", line 29, in run_pool_test
        self.loop.run_until_complete(run())
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
      File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_executors.py", line 24, in run
        res = await asyncio.gather(*coros)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
    _______________ TestAIOExecutors.test_executors_process_pool_01 ________________
    Traceback (most recent call last):
      File "/usr/lib64/python3.14/unittest/case.py", line 58, in testPartExecutor
        yield
      File "/usr/lib64/python3.14/unittest/case.py", line 660, in run
        self._callTestMethod(testMethod)
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/usr/lib64/python3.14/unittest/case.py", line 606, in _callTestMethod
        result = method()
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_executors.py", line 35, in test_executors_process_pool_01
        self.run_pool_test(concurrent.futures.ProcessPoolExecutor)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_executors.py", line 29, in run_pool_test
        self.loop.run_until_complete(run())
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
      File "/usr/lib64/python3.14/asyncio/base_events.py", line 719, in run_until_complete
        return future.result()
               ~~~~~~~~~~~~~^^
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_executors.py", line 24, in run
        res = await asyncio.gather(*coros)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
    ___________________ TestIssue39Regr.test_issue39_regression ____________________
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_regr1.py", line 114, in test_issue39_regression
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_regr1.py", line 93, in run_test
        addr = qout.get()
      File "/usr/lib64/python3.14/multiprocessing/queues.py", line 101, in get
        res = self._recv_bytes()
      File "/usr/lib64/python3.14/multiprocessing/connection.py", line 222, in recv_bytes
        buf = self._recv_bytes(maxlength)
      File "/usr/lib64/python3.14/multiprocessing/connection.py", line 437, in _recv_bytes
        buf = self._recv(4)
      File "/usr/lib64/python3.14/multiprocessing/connection.py", line 402, in _recv
        chunk = read(handle, to_read)
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_regr1.py", line 74, in on_alarm
        raise FailedTestError
    tests.test_regr1.FailedTestError
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/lib64/python3.14/unittest/case.py", line 58, in testPartExecutor
        yield
      File "/usr/lib64/python3.14/unittest/case.py", line 660, in run
        self._callTestMethod(testMethod)
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/usr/lib64/python3.14/unittest/case.py", line 606, in _callTestMethod
        result = method()
      File "/builddir/build/BUILD/python-uvloop-0.21.0-build/uvloop-0.21.0/_empty/tests/test_regr1.py", line 116, in test_issue39_regression
        self.fail('deadlocked in libuv')
        ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.14/unittest/case.py", line 741, in fail
        raise self.failureException(msg)
    AssertionError: deadlocked in libuv
    
  5. cjwatson commented on Apr 16, 2025

    @cjwatson
    Contributor

    @hroncok #662 should help with one of the failures there.

  6. Vizonex commented on May 20, 2025

    @Vizonex

    @hroncok I have been looking at your work rather closely since I am the maintainer of the windows branch since I am trying to get caught up with some of these changes being made here and I was wondering if maybe migrating to using AbstractEventLoop would be a good solution and then making some form a deprecation warning that discourages the usage of event-loop-policies.

  7. Ahajha commented on Oct 8, 2025

    @Ahajha

    Any update on this? Now that 3.14 is out it would be nice to get things working.

  8. michaelgmiller1 commented on Oct 9, 2025

    @michaelgmiller1

    +1 also blocked on the upgrade because of this

  9. added a commit that references this issue on Oct 10, 2025
  10. tajchert commented on Oct 12, 2025

    @tajchert

    Hi, thanks so much for the fix, however on pypi there is still no 0.22.0 release (as well github releases).

  11. edgarrmondragon commented on Oct 13, 2025

    @edgarrmondragon
    Contributor

    Hi, thanks so much for the fix, however on pypi there is still no 0.22.0 release (as well github releases).

    @tajchert it hasn't been published yet, see #692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions