Skip to content

Commit

Permalink
Fixed test failures caused by Python 3.14.0a5
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Feb 15, 2025
1 parent f44ad9f commit 8bad9c0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/versionhistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
- Added ``stdin`` argument to ``anyio.run_process()`` akin to what
``anyio.open_process()``, ``asyncio.create_subprocess_…()``, ``trio.run_process()``,
and ``subprocess.run()`` already accept (PR by @jmehnle)
- Added the ``info`` property to ``anyio.Path`` on Python 3.14
- Fixed traceback formatting growing quadratically with level of ``TaskGroup``
nesting on asyncio due to exception chaining when raising ``ExceptionGroups``
in ``TaskGroup.__aexit__``
Expand Down
15 changes: 10 additions & 5 deletions src/anyio/_core/_fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,15 @@ class Path:
* :meth:`~pathlib.Path.copy` (available on Python 3.14 or later)
* :meth:`~pathlib.Path.copy_into` (available on Python 3.14 or later)
* :meth:`~pathlib.Path.from_uri` (available on Python 3.13 or later)
* :meth:`~pathlib.Path.full_match` (available on Python 3.13 or later)
* :meth:`~pathlib.PurePath.full_match` (available on Python 3.13 or later)
* :attr:`~pathlib.Path.info` (available on Python 3.14 or later)
* :meth:`~pathlib.Path.is_junction` (available on Python 3.12 or later)
* :meth:`~pathlib.Path.match` (the ``case_sensitive`` parameter is only available on
Python 3.13 or later)
* :meth:`~pathlib.PurePath.match` (the ``case_sensitive`` parameter is only
available on Python 3.13 or later)
* :meth:`~pathlib.Path.move` (available on Python 3.14 or later)
* :meth:`~pathlib.Path.move_into` (available on Python 3.14 or later)
* :meth:`~pathlib.Path.relative_to` (the ``walk_up`` parameter is only available on
Python 3.12 or later)
* :meth:`~pathlib.PurePath.relative_to` (the ``walk_up`` parameter is only available
on Python 3.12 or later)
* :meth:`~pathlib.Path.walk` (available on Python 3.12 or later)
Any methods that do disk I/O need to be awaited on. These methods are:
Expand Down Expand Up @@ -411,6 +412,10 @@ def match(self, path_pattern: str) -> bool:

if sys.version_info >= (3, 14):

@property
def info(self) -> Any: # TODO: add return type annotation when Typeshed gets it
return self._path.info

async def copy(
self,
target: str | os.PathLike[str],
Expand Down
2 changes: 2 additions & 0 deletions tests/test_fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ async def test_properties(self) -> None:
stdlib_properties.discard("__enter__")
stdlib_properties.discard("__exit__")
stdlib_properties.discard("__firstlineno__")
stdlib_properties.discard("__open_rb__")
stdlib_properties.discard("__open_wb__")

async_path = Path(path)
anyio_properties = {
Expand Down

0 comments on commit 8bad9c0

Please sign in to comment.