4.9.0
Added 7
- Add async support for temporary file handling
- Add free_tcp_port_factory fixture to the pytest plugin for session-scoped generation of unused TCP port numbers
- Add free_udp_port_factory fixture to the pytest plugin for session-scoped generation of unused UDP port numbers
- Add free_tcp_port fixture to the pytest plugin for function-scoped generation of a free TCP port number
- Add free_udp_port fixture to the pytest plugin for function-scoped generation of a free UDP port number
- Add stdin argument to anyio.run_process()
- Add the info property to anyio.Path on Python 3.14
Changed 2
- Change anyio.getaddrinfo() to ignore invalid IPv6 name resolution results when IPv6 support is disabled in Python
- Change EndOfStream raised from MemoryObjectReceiveStream.receive() to exclude the AttributeError from the exception chain
Fixed 4
- Fix traceback formatting growing quadratically with level of TaskGroup nesting on asyncio due to exception chaining when raising ExceptionGroups in TaskGroup.__aexit__
- Fix anyio.Path.iterdir() making a blocking call in Python 3.13
- Fix connect_tcp() producing cyclic references in tracebacks when raising exceptions
- Fix anyio.to_thread.run_sync() needlessly holding on to references of the context, function, arguments and others until the next work item on asyncio
- Added async support for temporary file handling (#344; PR by @11kkw)
- Added 4 new fixtures for the AnyIO
pytestplugin:free_tcp_port_factory: session scoped fixture returning a callable that generates unused TCP port numbersfree_udp_port_factory: session scoped fixture returning a callable that generates unused UDP port numbersfree_tcp_port: function scoped fixture that invokes thefree_tcp_port_factoryfixture to generate a free TCP port numberfree_udp_port: function scoped fixture that invokes thefree_udp_port_factoryfixture to generate a free UDP port number
- Added
stdinargument toanyio.run_process()akin to whatanyio.open_process(),asyncio.create_subprocess(),trio.run_process(), andsubprocess.run()already accept (PR by @jmehnle) - Added the
infoproperty toanyio.Pathon Python 3.14 - Changed
anyio.getaddrinfo()to ignore (invalid) IPv6 name resolution results when IPv6 support is disabled in Python - Changed
EndOfStreamraised fromMemoryObjectReceiveStream.receive()to leave out theAttributeErrorfrom the exception chain which was merely an implementation detail and caused some confusion - Fixed traceback formatting growing quadratically with level of
TaskGroupnesting on asyncio due to exception chaining when raisingExceptionGroupsinTaskGroup.__aexit__(#863; PR by @tapetersen) - Fixed
anyio.Path.iterdir()making a blocking call in Python 3.13 (#873; PR by @cbornet and @agronholm) - Fixed
connect_tcp()producing cyclic references in tracebacks when raising exceptions (#809; PR by @graingert) - Fixed
anyio.to_thread.run_sync()needlessly holding on to references of the context, function, arguments and others until the next work item on asyncio (PR by @Wankupi)