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 wjwwood
Recipients gvanrossum, jab, oconnor663, vstinner, wjwwood, yselivanov
Date 2015-04-08.04:05:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428465932.34.0.706098937065.issue23548@psf.upfronthosting.co.za>
In-reply-to
Content
I was getting the same error as the OP in my application.

I did something like this to work around the problem:

import asyncio
import atexit

def close_asyncio_loop():
    loop = None
    try:
        loop = asyncio.get_event_loop()
    except AttributeError:
        pass
    if loop is not None:
        loop.close()

atexit.register(close_asyncio_loop)

Is this an appropriate work around?

Why is it up to the application to close the loop explicitly?

Put another way, in what scenario would I want to close the loop outside of the application shutting down since it is irreversible?

Thanks in advance for your time.
History
Date User Action Args
2015-04-08 04:05:32wjwwoodsetrecipients: + wjwwood, gvanrossum, vstinner, jab, yselivanov, oconnor663
2015-04-08 04:05:32wjwwoodsetmessageid: <1428465932.34.0.706098937065.issue23548@psf.upfronthosting.co.za>
2015-04-08 04:05:32wjwwoodlinkissue23548 messages
2015-04-08 04:05:32wjwwoodcreate