Subject: [PATCH] Fixed Path tests on Python 3.14.0a6

From: Alex Grönholm <[email-masked]>
Date: Tue, 18 Mar 2025 14:38:12 +0200

---
 src/anyio/_core/_fileio.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/anyio/_core/_fileio.py b/src/anyio/_core/_fileio.py
index a0d61984..17459b79 100644
--- a/src/anyio/_core/_fileio.py
+++ b/src/anyio/_core/_fileio.py
@@ -421,13 +421,11 @@ async def copy(
             target: str | os.PathLike[str],
             *,
             follow_symlinks: bool = True,
-            dirs_exist_ok: bool = False,
             preserve_metadata: bool = False,
         ) -> Path:
             func = partial(
                 self._path.copy,
                 follow_symlinks=follow_symlinks,
-                dirs_exist_ok=dirs_exist_ok,
                 preserve_metadata=preserve_metadata,
             )
             return Path(await to_thread.run_sync(func, target))
@@ -437,13 +435,11 @@ async def copy_into(
             target_dir: str | os.PathLike[str],
             *,
             follow_symlinks: bool = True,
-            dirs_exist_ok: bool = False,
             preserve_metadata: bool = False,
         ) -> Path:
             func = partial(
                 self._path.copy_into,
                 follow_symlinks=follow_symlinks,
-                dirs_exist_ok=dirs_exist_ok,
                 preserve_metadata=preserve_metadata,
             )
             return Path(await to_thread.run_sync(func, target_dir))
@@ -616,7 +612,9 @@ async def read_text(
         def relative_to(
             self, *other: str | PathLike[str], walk_up: bool = False
         ) -> Path:
-            return Path(self._path.relative_to(*other, walk_up=walk_up))
+            # relative_to() should work with any PathLike but it doesn't
+            others = [pathlib.Path(other) for other in other]
+            return Path(self._path.relative_to(*others, walk_up=walk_up))
 
     else: