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 vitaly.krug
Recipients asvetlov, vitaly.krug, yselivanov
Date 2018-03-26.22:50:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522104643.31.0.467229070634.issue33148@psf.upfronthosting.co.za>
In-reply-to
Content
I see this exception on the terminal:
```
exception calling callback for <Future at 0x10722ee48 state=finished returned list>
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/futures.py", line 414, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 620, in call_soon_threadsafe
    self._check_closed()
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 357, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
```

When executing this code:
```
import asyncio

while True:
    loop = asyncio.new_event_loop()

    coro = loop.getaddrinfo('www.google.com', 80)

    task = asyncio.ensure_future(coro, loop=loop)

    task.cancel()

    loop.call_soon_threadsafe(loop.stop)

    loop.run_forever()

    loop.close()
```

Shouldn't a cancelled operation go away (or at least pretend to go away) cleanly?
History
Date User Action Args
2018-03-26 22:50:43vitaly.krugsetrecipients: + vitaly.krug, asvetlov, yselivanov
2018-03-26 22:50:43vitaly.krugsetmessageid: <1522104643.31.0.467229070634.issue33148@psf.upfronthosting.co.za>
2018-03-26 22:50:43vitaly.kruglinkissue33148 messages
2018-03-26 22:50:43vitaly.krugcreate