Bug 2357902

Summary: python-anyio fails to build with Python 3.14: AttributeError: 'Path' object has no attribute '_tail' & TypeError: Path.copy_into() got an unexpected keyword argument 'dirs_exist_ok'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-anyioAssignee: Ben Beasley <code>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: carl, code, ksurma, mail, mhroncok, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-anyio-4.8.0-3.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-04-07 14:45:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407    

Description Karolina Surma 2025-04-07 13:01:28 UTC
python-anyio fails to build with Python 3.14.0a6.

A new set of test failures appeared with the recent alpha:

_________________________ TestPath.test_copy[asyncio] __________________________
tests/test_fileio.py:339: in test_copy
    result = await source_path.copy(destination_path)  # type: ignore[attr-defined]
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:430: in copy
    return Path(await to_thread.run_sync(func, target))
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:2461: in run_sync_in_worker_thread
    return await future
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:962: in run
    result = context.run(func, *args)
E   TypeError: Path.copy() got an unexpected keyword argument 'dirs_exist_ok'
______________________ TestPath.test_copy[asyncio+eager] _______________________
tests/test_fileio.py:339: in test_copy
    result = await source_path.copy(destination_path)  # type: ignore[attr-defined]
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:430: in copy
    return Path(await to_thread.run_sync(func, target))
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:2461: in run_sync_in_worker_thread
    return await future
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:962: in run
    result = context.run(func, *args)
E   TypeError: Path.copy() got an unexpected keyword argument 'dirs_exist_ok'
___________________________ TestPath.test_copy[trio] ___________________________
tests/test_fileio.py:339: in test_copy
    result = await source_path.copy(destination_path)  # type: ignore[attr-defined]
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:430: in copy
    return Path(await to_thread.run_sync(func, target))
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_trio.py:1079: in run_sync_in_worker_thread
    return await run_sync(
/usr/lib/python3.14/site-packages/trio/_threads.py:447: in to_thread_run_sync
    return msg_from_thread.unwrap()
/usr/lib/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
/usr/lib/python3.14/site-packages/trio/_threads.py:373: in do_release_then_return_result
    return result.unwrap()
/usr/lib/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
/usr/lib/python3.14/site-packages/trio/_threads.py:392: in worker_fn
    ret = context.run(sync_fn, *args)
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_trio.py:1076: in wrapper
    return func(*args)
E   TypeError: Path.copy() got an unexpected keyword argument 'dirs_exist_ok'
_______________________ TestPath.test_copy_into[asyncio] _______________________
tests/test_fileio.py:351: in test_copy_into
    result = await source_path.copy_into(destination_path)  # type: ignore[attr-defined]
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:446: in copy_into
    return Path(await to_thread.run_sync(func, target_dir))
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:2461: in run_sync_in_worker_thread
    return await future
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:962: in run
    result = context.run(func, *args)
E   TypeError: Path.copy_into() got an unexpected keyword argument 'dirs_exist_ok'
____________________ TestPath.test_copy_into[asyncio+eager] ____________________
tests/test_fileio.py:351: in test_copy_into
    result = await source_path.copy_into(destination_path)  # type: ignore[attr-defined]
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:446: in copy_into
    return Path(await to_thread.run_sync(func, target_dir))
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:2461: in run_sync_in_worker_thread
    return await future
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_asyncio.py:962: in run
    result = context.run(func, *args)
E   TypeError: Path.copy_into() got an unexpected keyword argument 'dirs_exist_ok'
________________________ TestPath.test_copy_into[trio] _________________________
tests/test_fileio.py:351: in test_copy_into
    result = await source_path.copy_into(destination_path)  # type: ignore[attr-defined]
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:446: in copy_into
    return Path(await to_thread.run_sync(func, target_dir))
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_trio.py:1079: in run_sync_in_worker_thread
    return await run_sync(
/usr/lib/python3.14/site-packages/trio/_threads.py:447: in to_thread_run_sync
    return msg_from_thread.unwrap()
/usr/lib/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
/usr/lib/python3.14/site-packages/trio/_threads.py:373: in do_release_then_return_result
    return result.unwrap()
/usr/lib/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
/usr/lib/python3.14/site-packages/trio/_threads.py:392: in worker_fn
    ret = context.run(sync_fn, *args)
../BUILDROOT/usr/lib/python3.14/site-packages/anyio/_backends/_trio.py:1076: in wrapper
    return func(*args)
E   TypeError: Path.copy_into() got an unexpected keyword argument 'dirs_exist_ok'
__________________ TestPath.test_relative_to_sibling[asyncio] __________________
/builddir/build/BUILD/python-anyio-4.8.0-build/anyio-4.8.0/tests/test_fileio.py:548: in test_relative_to_sibling
    relpath = subdir.relative_to(sibdir, walk_up=True) / "dummyfile1.txt"
/builddir/build/BUILD/python-anyio-4.8.0-build/BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:611: in relative_to
    return Path(self._path.relative_to(*other, walk_up=walk_up))
/usr/lib64/python3.14/pathlib/__init__.py:500: in relative_to
    parts = ['..'] * step + self._tail[len(path._tail):]
E   AttributeError: 'Path' object has no attribute '_tail'
_______________ TestPath.test_relative_to_sibling[asyncio+eager] _______________
/builddir/build/BUILD/python-anyio-4.8.0-build/anyio-4.8.0/tests/test_fileio.py:548: in test_relative_to_sibling
    relpath = subdir.relative_to(sibdir, walk_up=True) / "dummyfile1.txt"
/builddir/build/BUILD/python-anyio-4.8.0-build/BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:611: in relative_to
    return Path(self._path.relative_to(*other, walk_up=walk_up))
/usr/lib64/python3.14/pathlib/__init__.py:500: in relative_to
    parts = ['..'] * step + self._tail[len(path._tail):]
E   AttributeError: 'Path' object has no attribute '_tail'
___________________ TestPath.test_relative_to_sibling[trio] ____________________
/builddir/build/BUILD/python-anyio-4.8.0-build/anyio-4.8.0/tests/test_fileio.py:548: in test_relative_to_sibling
    relpath = subdir.relative_to(sibdir, walk_up=True) / "dummyfile1.txt"
/builddir/build/BUILD/python-anyio-4.8.0-build/BUILDROOT/usr/lib/python3.14/site-packages/anyio/_core/_fileio.py:611: in relative_to
    return Path(self._path.relative_to(*other, walk_up=walk_up))
/usr/lib64/python3.14/pathlib/__init__.py:500: in relative_to
    parts = ['..'] * step + self._tail[len(path._tail):]
E   AttributeError: 'Path' object has no attribute '_tail'


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/08848377-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 Ben Beasley 2025-04-07 13:51:13 UTC
https://src.fedoraproject.org/rpms/python-anyio/pull-request/14

Tested locally; will merge and build after CI finishes.

Comment 2 Fedora Update System 2025-04-07 14:43:51 UTC
FEDORA-2025-19a80c1dc4 (python-anyio-4.8.0-3.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-19a80c1dc4

Comment 3 Fedora Update System 2025-04-07 14:45:56 UTC
FEDORA-2025-19a80c1dc4 (python-anyio-4.8.0-3.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.