This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author graingert
Recipients Dima.Tisnek, asvetlov, graingert, lukasz.langa, ncoghlan, yselivanov
Date 2021-12-06.14:25:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638800735.76.0.0761079484011.issue45996@roundup.psfhosted.org>
In-reply-to
Content
ah I can repeat this on python3.8.10 trio but not python3.9.9 trio:

```
import logging
import trio
from contextlib import asynccontextmanager

@asynccontextmanager
async def foo():
    await trio.sleep(1)
    yield


async def test():
    async with trio.open_nursery() as n:
        f = foo()
        n.start_soon(f.__aenter__)
        n.start_soon(f.__aenter__)

trio.run(test)

```

```
Traceback (most recent call last):
  File "bar.py", line 17, in <module>
    trio.run(test)
  File "/home/graingert/.virtualenvs/osirium-main/lib/python3.8/site-packages/trio/_core/_run.py", line 1932, in run
    raise runner.main_task_outcome.error
  File "bar.py", line 15, in test
    n.start_soon(f.__aenter__)
  File "/home/graingert/.virtualenvs/osirium-main/lib/python3.8/site-packages/trio/_core/_run.py", line 815, in __aexit__
    raise combined_error_from_nursery
  File "/usr/lib/python3.8/contextlib.py", line 171, in __aenter__
    return await self.gen.__anext__()
RuntimeError: anext(): asynchronous generator is already running
```
History
Date User Action Args
2021-12-06 14:25:35graingertsetrecipients: + graingert, ncoghlan, asvetlov, lukasz.langa, Dima.Tisnek, yselivanov
2021-12-06 14:25:35graingertsetmessageid: <1638800735.76.0.0761079484011.issue45996@roundup.psfhosted.org>
2021-12-06 14:25:35graingertlinkissue45996 messages
2021-12-06 14:25:35graingertcreate