Chetan Reddy added the comment:

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.

----------
nosy: +chetan

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23548>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to