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 chetan
Recipients chetan, gvanrossum, jab, oconnor663, vstinner, wjwwood, yselivanov
Date 2015-08-08.15:24:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439047486.96.0.733246080582.issue23548@psf.upfronthosting.co.za>
In-reply-to
Content
I'm seeing the same exception as op with Python-3.5.0b4.

I'm writing a function in a library, and am using asyncio to make my function run faster. I'd like my library function to be useful even to users who aren't using asyncio and therefore won't call get_event_loop().close() at the end of their main function.

I can't call get_event_loop().close() in my own library function, because i don't want to be closing the event loop in case the user is using the event loop.

Is the recommended approach here for me to create my own loop and close it in my function (while saving and restoring the existing event loop in case the user has already created an event loop)? Guido's comment at http://bugs.python.org/msg205027 makes me think not.

The easiest solution might be to not require the user to call get_event_loop().close() . This will allow library writers to use asyncio.run_until_complete without worrying the user seeing an exception on exit. If you agree with this, I'm willing to spend the effort to track down this particular exception and provide a patch to fix it.
History
Date User Action Args
2015-08-08 15:24:47chetansetrecipients: + chetan, gvanrossum, vstinner, jab, yselivanov, oconnor663, wjwwood
2015-08-08 15:24:46chetansetmessageid: <1439047486.96.0.733246080582.issue23548@psf.upfronthosting.co.za>
2015-08-08 15:24:46chetanlinkissue23548 messages
2015-08-08 15:24:46chetancreate