Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-anyio for openSUSE:Factory checked in at 2021-10-18 21:59:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-anyio (Old) and /work/SRC/openSUSE:Factory/.python-anyio.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-anyio" Mon Oct 18 21:59:05 2021 rev:5 rq:925754 version:3.3.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-anyio/python-anyio.changes 2021-09-17 23:26:34.061269147 +0200 +++ /work/SRC/openSUSE:Factory/.python-anyio.new.1890/python-anyio.changes 2021-10-18 22:01:55.314081841 +0200 @@ -1,0 +2,12 @@ +Sat Oct 16 21:03:37 UTC 2021 - Dirk M??ller <dmuel...@suse.com> + +- update to 3.3.3: + * Fixed UNIX socket listener not setting accepted sockets to non-blocking + mode on asyncio + * Changed unconnected UDP sockets to be always bound to a local port (on + "any" interface) to avoid errors on asyncio + Windows + * Fixed cancellation problem on asyncio where level-triggered cancellation + for **all** parent cancel scopes would not resume after exiting a + shielded nested scope + +------------------------------------------------------------------- Old: ---- anyio-3.3.1.tar.gz New: ---- anyio-3.3.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-anyio.spec ++++++ --- /var/tmp/diff_new_pack.ZITkWe/_old 2021-10-18 22:01:55.742082150 +0200 +++ /var/tmp/diff_new_pack.ZITkWe/_new 2021-10-18 22:01:55.742082150 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-anyio -Version: 3.3.1 +Version: 3.3.3 Release: 0 Summary: High level compatibility layer for asynchronous event loop implementations License: MIT ++++++ anyio-3.3.1.tar.gz -> anyio-3.3.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/.github/workflows/codeqa-test.yml new/anyio-3.3.3/.github/workflows/codeqa-test.yml --- old/anyio-3.3.1/.github/workflows/codeqa-test.yml 2021-09-08 23:07:33.000000000 +0200 +++ new/anyio-3.3.3/.github/workflows/codeqa-test.yml 2021-10-10 21:09:00.000000000 +0200 @@ -33,22 +33,24 @@ fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev, pypy3] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", pypy-3.7] exclude: - os: macos-latest - python-version: 3.7 + python-version: "3.7" - os: macos-latest - python-version: 3.8 + python-version: "3.8" - os: macos-latest - python-version: 3.10.0-beta.4 + python-version: "3.9" - os: macos-latest - python-version: pypy3 + python-version: pypy-3.7 - os: windows-latest - python-version: 3.7 + python-version: "3.7" - os: windows-latest - python-version: 3.8 + python-version: "3.8" - os: windows-latest - python-version: pypy3 # https://github.com/python-trio/trio/issues/1361 + python-version: "3.9" + - os: windows-latest + python-version: pypy-3.7 # https://github.com/python-trio/trio/issues/1361 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/PKG-INFO new/anyio-3.3.3/PKG-INFO --- old/anyio-3.3.1/PKG-INFO 2021-09-08 23:07:43.435082400 +0200 +++ new/anyio-3.3.3/PKG-INFO 2021-10-10 21:09:09.796313800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: anyio -Version: 3.3.1 +Version: 3.3.3 Summary: High level compatibility layer for multiple asynchronous event loop implementations Home-page: UNKNOWN Author: Alex Gr??nholm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/docs/versionhistory.rst new/anyio-3.3.3/docs/versionhistory.rst --- old/anyio-3.3.1/docs/versionhistory.rst 2021-09-08 23:07:33.000000000 +0200 +++ new/anyio-3.3.3/docs/versionhistory.rst 2021-10-10 21:09:00.000000000 +0200 @@ -3,6 +3,18 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_. +**3.3.3** + +- Fixed UNIX socket listener not setting accepted sockets to non-blocking mode on asyncio +- Changed unconnected UDP sockets to be always bound to a local port (on "any" interface) to avoid + errors on asyncio + Windows + +**3.3.2** + +- Fixed cancellation problem on asyncio where level-triggered cancellation for **all** parent + cancel scopes would not resume after exiting a shielded nested scope + (`#370 <https://github.com/agronholm/anyio/issues/370>`_) + **3.3.1** - Added missing documentation for the ``ExceptionGroup.exceptions`` attribute diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/pyproject.toml new/anyio-3.3.3/pyproject.toml --- old/anyio-3.3.1/pyproject.toml 2021-09-08 23:07:33.000000000 +0200 +++ new/anyio-3.3.3/pyproject.toml 2021-10-10 21:09:00.000000000 +0200 @@ -38,7 +38,9 @@ filterwarnings = [ "error", "ignore:unclosed <socket.socket.*:ResourceWarning", - "ignore:unclosed transport <_ProactorSocketTransport.*:ResourceWarning" + "ignore:unclosed transport <_ProactorSocketTransport.*:ResourceWarning", + # Workaround for Python 3.9.7 (see https://bugs.python.org/issue45097) + "ignore:The loop argument is deprecated since Python 3\\.8, and scheduled for removal in Python 3\\.10\\.:DeprecationWarning:asyncio" ] markers = [ "network: marks tests as requiring Internet access", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/src/anyio/_backends/_asyncio.py new/anyio-3.3.3/src/anyio/_backends/_asyncio.py --- old/anyio-3.3.1/src/anyio/_backends/_asyncio.py 2021-09-08 23:07:33.000000000 +0200 +++ new/anyio-3.3.3/src/anyio/_backends/_asyncio.py 2021-10-10 21:09:00.000000000 +0200 @@ -305,7 +305,7 @@ host_task_state.cancel_scope = self._parent_scope - # Restart the cancellation effort in the nearest directly cancelled parent scope if this + # Restart the cancellation effort in the farthest directly cancelled parent scope if this # one was shielded if self._shield: self._deliver_cancellation_to_parent() @@ -365,12 +365,12 @@ self._cancel_handle = None def _deliver_cancellation_to_parent(self) -> None: - """Start cancellation effort in the nearest directly cancelled parent scope""" + """Start cancellation effort in the farthest directly cancelled parent scope""" scope = self._parent_scope + scope_to_cancel: Optional[CancelScope] = None while scope is not None: if scope._cancel_called and scope._cancel_handle is None: - scope._deliver_cancellation() - break + scope_to_cancel = scope # No point in looking beyond any shielded scope if scope._shield: @@ -378,6 +378,9 @@ scope = scope._parent_scope + if scope_to_cancel is not None: + scope_to_cancel._deliver_cancellation() + def _parent_cancelled(self) -> bool: # Check whether any parent has been cancelled cancel_scope = self._parent_scope @@ -1373,6 +1376,7 @@ while True: try: client_sock, _ = self.__raw_socket.accept() + client_sock.setblocking(False) return UNIXSocketStream(client_sock) except BlockingIOError: f: asyncio.Future = asyncio.Future() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/src/anyio/_core/_sockets.py new/anyio-3.3.3/src/anyio/_core/_sockets.py --- old/anyio-3.3.1/src/anyio/_core/_sockets.py 2021-09-08 23:07:33.000000000 +0200 +++ new/anyio-3.3.3/src/anyio/_core/_sockets.py 2021-10-10 21:09:00.000000000 +0200 @@ -330,13 +330,16 @@ if family is AddressFamily.AF_UNSPEC and not local_host: raise ValueError('Either "family" or "local_host" must be given') - local_address: Optional[IPSockAddrType] = None if local_host: gai_res = await getaddrinfo(str(local_host), local_port, family=family, type=socket.SOCK_DGRAM, flags=socket.AI_PASSIVE | socket.AI_ADDRCONFIG) family = cast(AnyIPAddressFamily, gai_res[0][0]) local_address = gai_res[0][-1] + elif family is AddressFamily.AF_INET6: + local_address = ('::', 0) + else: + local_address = ('0.0.0.0', 0) return await get_asynclib().create_udp_socket(family, local_address, None, reuse_port) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/src/anyio.egg-info/PKG-INFO new/anyio-3.3.3/src/anyio.egg-info/PKG-INFO --- old/anyio-3.3.1/src/anyio.egg-info/PKG-INFO 2021-09-08 23:07:43.000000000 +0200 +++ new/anyio-3.3.3/src/anyio.egg-info/PKG-INFO 2021-10-10 21:09:09.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: anyio -Version: 3.3.1 +Version: 3.3.3 Summary: High level compatibility layer for multiple asynchronous event loop implementations Home-page: UNKNOWN Author: Alex Gr??nholm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/tests/test_sockets.py new/anyio-3.3.3/tests/test_sockets.py --- old/anyio-3.3.1/tests/test_sockets.py 2021-09-08 23:07:33.000000000 +0200 +++ new/anyio-3.3.3/tests/test_sockets.py 2021-10-10 21:09:00.000000000 +0200 @@ -12,7 +12,7 @@ from socket import AddressFamily from ssl import SSLContext, SSLError from threading import Thread -from typing import Any, Iterable, Iterator, List, NoReturn, Tuple, Type, TypeVar, Union +from typing import Any, Iterable, Iterator, List, NoReturn, Tuple, Type, TypeVar, Union, cast import pytest from _pytest.fixtures import SubRequest @@ -25,7 +25,7 @@ TypedAttributeLookupError, connect_tcp, connect_unix, create_connected_udp_socket, create_task_group, create_tcp_listener, create_udp_socket, create_unix_listener, fail_after, getaddrinfo, getnameinfo, move_on_after, sleep, wait_all_tasks_blocked) -from anyio.abc import Listener, SocketAttribute, SocketListener, SocketStream +from anyio.abc import IPSockAddrType, Listener, SocketAttribute, SocketListener, SocketStream from anyio.streams.stapled import MultiListener if sys.version_info >= (3, 8): @@ -489,6 +489,7 @@ assert isinstance(listener, SocketListener) async with await listener.accept() as stream: raw_socket = stream.extra(SocketAttribute.raw_socket) + assert raw_socket.gettimeout() == 0 assert raw_socket.family == listener.extra(SocketAttribute.family) assert raw_socket.getsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY) != 0 @@ -840,6 +841,7 @@ client.connect(listener_socket.getsockname()) async with await listener.accept() as stream: + assert stream.extra(SocketAttribute.raw_socket).gettimeout() == 0 assert stream.extra(SocketAttribute.family) == listener_socket.family client.close() @@ -876,9 +878,6 @@ pass -IPSockAddrType = Tuple[str, int] - - async def test_multi_listener(tmp_path_factory: TempPathFactory) -> None: async def handle(stream: SocketStream) -> None: client_addresses.append(stream.extra(SocketAttribute.remote_address)) @@ -920,6 +919,7 @@ async def test_extra_attributes(self, family: AnyIPAddressFamily) -> None: async with await create_udp_socket(family=family, local_host='localhost') as udp: raw_socket = udp.extra(SocketAttribute.raw_socket) + assert raw_socket.gettimeout() == 0 assert udp.extra(SocketAttribute.family) == family assert udp.extra(SocketAttribute.local_address) == raw_socket.getsockname()[:2] assert udp.extra(SocketAttribute.local_port) == raw_socket.getsockname()[1] @@ -1005,6 +1005,12 @@ with pytest.raises(ClosedResourceError): await udp.sendto(b'foo', host, port) + async def test_create_unbound_socket(self, family: AnyIPAddressFamily) -> None: + """Regression test for #360.""" + async with await create_udp_socket(family=family) as udp: + local_address = cast(IPSockAddrType, udp.extra(SocketAttribute.local_address)) + assert local_address[1] > 0 + @pytest.mark.usefixtures('check_asyncio_bug') class TestConnectedUDPSocket: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/anyio-3.3.1/tests/test_taskgroups.py new/anyio-3.3.3/tests/test_taskgroups.py --- old/anyio-3.3.1/tests/test_taskgroups.py 2021-09-08 23:07:33.000000000 +0200 +++ new/anyio-3.3.3/tests/test_taskgroups.py 2021-10-10 21:09:00.000000000 +0200 @@ -12,6 +12,7 @@ CancelScope, ExceptionGroup, create_task_group, current_effective_deadline, current_time, fail_after, get_cancelled_exc_class, move_on_after, sleep, wait_all_tasks_blocked) from anyio.abc import TaskGroup, TaskStatus +from anyio.lowlevel import checkpoint if sys.version_info < (3, 7): current_task = asyncio.Task.current_task @@ -246,7 +247,7 @@ assert result is None -async def test_edge_cancellation() -> None: +async def test_level_cancellation() -> None: marker = None async def dummy() -> None: @@ -723,6 +724,29 @@ await sleep(2) +async def test_triple_nested_shield() -> None: + """Regression test for #370.""" + + got_past_checkpoint = False + + async def taskfunc() -> None: + nonlocal got_past_checkpoint + + with CancelScope() as scope1: + with CancelScope() as scope2: + with CancelScope(shield=True): + scope1.cancel() + scope2.cancel() + + await checkpoint() + got_past_checkpoint = True + + async with create_task_group() as tg: + tg.start_soon(taskfunc) + + assert not got_past_checkpoint + + def test_task_group_in_generator(anyio_backend_name: str, anyio_backend_options: Dict[str, Any]) -> None: async def task_group_generator() -> AsyncGenerator[None, None]: