Skip to content

Poking at Trio with .send(None) and... it told me to report this #1055

@altendky

Description

@altendky

https://repl.it/@altendky/UnhappyGenuineConversions-4

I was just poking at Trio to see what happened and don't personally consider a failure here a bug. But, the error told me to report it so here I am, being obedient. If you close this issue saying that s.send(None) is evil and this is an ok way to respond to it, I'm totally fine with that.

import trio


async def main():
    s = trio.sleep(2)

    async with trio.open_nursery() as nursery:
        s.send(None)
        print('nursery end')

    print('main end')
 

trio.run(main)
Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux


Repl.it: Installing fresh packages

Collecting trio==0.11.0 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/16/88/b663a136d1083aeda965dfb58206ee6437c7920df7615415c4407169cbee/trio-0.11.0-py3-none-any.whl (289kB)
Requirement already satisfied: idna in /usr/local/lib/python3.6/site-packages (from trio==0.11.0->-r requirements.txt (line 1)) (2.8)
Collecting outcome (from trio==0.11.0->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/b9/3e/88cf8cbc591682e4ef27f61044496ca66733210b57ce01000ffec8b29d88/outcome-1.0.0-py2.py3-none-any.whl
Collecting async-generator>=1.9 (from trio==0.11.0->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/71/52/39d20e03abd0ac9159c162ec24b93fbcaa111e8400308f2465432495ca2b/async_generator-1.10-py3-none-any.whl
Collecting attrs>=18.2.0 (from trio==0.11.0->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl
Collecting contextvars>=2.1; python_version < "3.7" (from trio==0.11.0->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/83/96/55b82d9f13763be9d672622e1b8106c85acb83edd7cc2fa5bc67cd9877e9/contextvars-2.4.tar.gz
Collecting sniffio (from trio==0.11.0->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/b3/82/4bd4b7d9c0d1dc0fbfbc2a1e00138e7f3ab85bc239358fe9b78aa2ab586d/sniffio-1.1.0-py3-none-any.whl
Collecting sortedcontainers (from trio==0.11.0->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/13/f3/cf85f7c3a2dbd1a515d51e1f1676d971abe41bba6f4ab5443240d9a78e5b/sortedcontainers-2.1.0-py2.py3-none-any.whl
Collecting immutables>=0.9 (from contextvars>=2.1; python_version < "3.7"->trio==0.11.0->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/e3/91/bc4b34993ef77aabfd1546a657563576bdd437205fa24d4acaf232707452/immutables-0.9-cp36-cp36m-manylinux1_x86_64.whl (91kB)
Building wheels for collected packages: contextvars
  Building wheel for contextvars (setup.py): started
  Building wheel for contextvars (setup.py): finished with status 'done'
  Stored in directory: /home/runner/.cache/pip/wheels/a5/7d/68/1ebae2668bda2228686e3c1cf16f2c2384cea6e9334ad5f6de
Successfully built contextvars
Installing collected packages: attrs, outcome, async-generator, immutables, contextvars, sniffio, sortedcontainers, trio
Successfully installed async-generator-1.10 attrs-19.1.0 contextvars-2.4 immutables-0.9 outcome-1.0.0 sniffio-1.1.0 sortedcontainers-2.1.0 trio-0.11.0
nursery end
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.6/site-packages/trio/_core/_run.py", line 1430, in run
    run_impl(runner, async_fn, args)
  File "/home/runner/.local/lib/python3.6/site-packages/trio/_core/_run.py", line 1579, in run_impl
    runner.task_exited(task, final_outcome)
  File "/home/runner/.local/lib/python3.6/site-packages/trio/_core/_run.py", line 1050, in task_exited
    task._cancel_stack[-1]._remove_task(task)
  File "/home/runner/.local/lib/python3.6/site-packages/trio/_core/_run.py", line 347, in _remove_task
    self._tasks.remove(task)
KeyError: <Task '__main__.main' at 0x7fcbea2a7198>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "main.py", line 14, in <module>
    trio.run(main)
  File "/home/runner/.local/lib/python3.6/site-packages/trio/_core/_run.py", line 1436, in run
    ) from exc
trio.TrioInternalError: internal error in trio - please file a bug!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions