Bug 2328710 - python-anyio fails to build with Python 3.14: AttributeError: '_UnixDefaultEventLoopPolicy' object has no attribute 'get_child_watcher' && TypeError: PurePath.relative_to() takes 2 positional arguments but 3 were given
Summary: python-anyio fails to build with Python 3.14: AttributeError: '_UnixDefaultEv...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-anyio
Version: 42
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-25 16:35 UTC by Karolina Surma
Modified: 2025-02-26 13:18 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-26 13:12:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-anyio pull-request 11 0 None None None 2025-01-06 17:44:07 UTC

Description Karolina Surma 2024-11-25 16:35:00 UTC
python-anyio fails to build with Python 3.14.0a2.

8 tests failed. The example failures:

_________________________ test_cancel_during[asyncio] __________________________
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/pytest_plugin.py:117: in pytest_pyfunc_call
    runner.run_test(pyfuncitem.obj, testargs)
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:2117: in run_test
    self._raise_async_exceptions()
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:2054: in _raise_async_exceptions
    raise exceptions[0]
/usr/lib64/python3.14/asyncio/events.py:88: in _run
    self._context.run(self._callback, *self._args)
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:1064: in _forcibly_shutdown_process_pool_on_exit
    child_watcher = asyncio.get_event_loop_policy().get_child_watcher()
E   AttributeError: '_UnixDefaultEventLoopPolicy' object has no attribute 'get_child_watcher'

___________________ TestPath.test_is_relative_to[args0-True] ___________________
tests/test_fileio.py:284: in test_is_relative_to
    assert Path("/xyz/abc/foo").is_relative_to(*args) == result
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:376: in is_relative_to
    self.relative_to(*other)
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:509: in relative_to
    return Path(self._path.relative_to(*other))
E   TypeError: PurePath.relative_to() takes 2 positional arguments but 3 were given

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08311144-python-anyio/

For all our attempts to build python-anyio with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-anyio/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2025-01-06 16:50:04 UTC
https://github.com/agronholm/anyio/pull/813

Comment 2 Miro Hrončok 2025-01-06 17:44:07 UTC
Actually, it is this old Python 3.12 support commit which makes the tests pass: https://github.com/agronholm/anyio/commit/c221f87a10046725a024dbfa6244b7104accea14

Unfortunately, it breaks the API a bit.

Comment 3 Miro Hrončok 2025-02-26 13:12:29 UTC
This particular failure is fixed.

I'll close this. A new bugzilla for the current failures will appear soon-ish.

Comment 4 Aoife Moloney 2025-02-26 13:18:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


Note You need to log in before you can comment on or make changes to this bug.