{"action":"closed","issue":{"url":"https://api.github.com/repos/agronholm/anyio/issues/11","repository_url":"https://api.github.com/repos/agronholm/anyio","labels_url":"https://api.github.com/repos/agronholm/anyio/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/agronholm/anyio/issues/11/comments","events_url":"https://api.github.com/repos/agronholm/anyio/issues/11/events","html_url":"https://github.com/agronholm/anyio/issues/11","id":369805063,"node_id":"MDU6SXNzdWUzNjk4MDUwNjM=","number":11,"title":"[Trio] Task groups are marked inactive early","user":{"login":"Fuyukai","id":8783751,"node_id":"MDQ6VXNlcjg3ODM3NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/8783751?v=4","gravatar_id":"","url":"https://api.github.com/users/Fuyukai","html_url":"https://github.com/Fuyukai","followers_url":"https://api.github.com/users/Fuyukai/followers","following_url":"https://api.github.com/users/Fuyukai/following{/other_user}","gists_url":"https://api.github.com/users/Fuyukai/gists{/gist_id}","starred_url":"https://api.github.com/users/Fuyukai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fuyukai/subscriptions","organizations_url":"https://api.github.com/users/Fuyukai/orgs","repos_url":"https://api.github.com/users/Fuyukai/repos","events_url":"https://api.github.com/users/Fuyukai/events{/privacy}","received_events_url":"https://api.github.com/users/Fuyukai/received_events","type":"User","site_admin":false},"labels":[{"id":1029017772,"node_id":"MDU6TGFiZWwxMDI5MDE3Nzcy","url":"https://api.github.com/repos/agronholm/anyio/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-13T14:02:44Z","updated_at":"2018-10-14T06:58:47Z","closed_at":"2018-10-14T06:58:47Z","author_association":"NONE","body":"Code:\r\n```py\r\nimport anyio\r\n\r\n\r\nasync def second():\r\n    print(\"This never happens\")\r\n\r\n\r\nasync def first(tg):\r\n    await anyio.sleep(0)\r\n    await tg.spawn(second)\r\n\r\n\r\nasync def main():\r\n    async with anyio.create_task_group() as tg:\r\n        await tg.spawn(first, tg)\r\n\r\n\r\nanyio.run(main, backend=\"trio\")\r\n```\r\n\r\nError:\r\n```py\r\nTraceback (most recent call last):\r\n  File \"/home/laura/dev/discord/curious/aaa.py\", line 18, in <module>\r\n    anyio.run(main, backend=\"trio\")\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/anyio/__init__.py\", line 112, in run\r\n    return asynclib.run(func, *args, **backend_options)\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/trio/_core/_run.py\", line 1337, in run\r\n    raise runner.main_task_outcome.error\r\n  File \"/home/laura/dev/discord/curious/aaa.py\", line 15, in main\r\n    await tg.spawn(first, tg)\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/async_generator/_util.py\", line 42, in __aexit__\r\n    await self._agen.asend(None)\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/async_generator/_impl.py\", line 366, in step\r\n    return await ANextIter(self._it, start_fn, *args)\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/async_generator/_impl.py\", line 202, in send\r\n    return self._invoke(self._it.send, value)\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/async_generator/_impl.py\", line 209, in _invoke\r\n    result = fn(*args)\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/anyio/_backends/trio.py\", line 90, in create_task_group\r\n    tg._active = False\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/trio/_core/_run.py\", line 397, in __aexit__\r\n    raise combined_error_from_nursery\r\n  File \"/home/laura/dev/discord/curious/aaa.py\", line 10, in first\r\n    await tg.spawn(second)\r\n  File \"/home/laura/.local/share/virtualenvs/curious-yiBjxk2Q/lib/python3.7/site-packages/anyio/_backends/trio.py\", line 78, in spawn\r\n    raise RuntimeError('This task group is not active; no new tasks can be spawned.')\r\nRuntimeError: This task group is not active; no new tasks can be spawned.\r\n```\r\n\r\nBoth curio and asyncio backends allow this to work."}}
{"actor":{"display_login":"agronholm"}}