[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-10 Thread tomaszdrozdz


tomaszdrozdz  added the comment:

I just wanted to call  

def main():
asyncio.run(...)

But I can go with Your aproach.  
Thanks for discusion.  

Should I set status for this issue for closed with resolution rejected ?  

Should I delete branch on my forked git repo ?
Can I delete my forked git repo ?

--

___
Python tracker 
<https://bugs.python.org/issue41202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-09 Thread tomaszdrozdz


tomaszdrozdz  added the comment:

OK.  
I understand.  

So how about maybe:  

def run(main, *, debug=False, loop=None):  
...  

if loop:  
loop = events.new_event_loop()

So we could customize loop like:  

loop = events.new_event_loop()  
loop.set_XXX(...)  
asyncio.run(my_coro, loop=loop)  

Just what tehn with debug parameter ?

--

___
Python tracker 
<https://bugs.python.org/issue41202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-07 Thread tomaszdrozdz


tomaszdrozdz  added the comment:

https://docs.python.org/3/library/asyncio-eventloop.html#error-handling-api  

Here we can read:  

Application developers should typically use the high-level asyncio functions, 
such as asyncio.run(), and should rarely need to reference the loop object or 
call its methods. This section is intended mostly for authors of lower-level 
code, libraries, and frameworks, who need finer control over the event loop 
behavior.  


So as I understand this - I should not use  
asyncio.get_running_loop  
loop.set_exception_handler(...)  

Or maybe event loop should not be in "Low level api"  ???

--

___
Python tracker 
<https://bugs.python.org/issue41202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-03 Thread tomaszdrozdz


Change by tomaszdrozdz :


--
keywords: +patch
pull_requests: +20444
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21295

___
Python tracker 
<https://bugs.python.org/issue41202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-03 Thread tomaszdrozdz


Change by tomaszdrozdz :


--
title: Allo to provide custom exception handler to asyncio.run() -> Allow to 
provide custom exception handler to asyncio.run()

___
Python tracker 
<https://bugs.python.org/issue41202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41202] Allo to provide custom exception handler to asyncio.run()

2020-07-03 Thread tomaszdrozdz


New submission from tomaszdrozdz :

I wish we had:  

asyncio.run(coro, *, debug=False, excepton_handler=None)

so we could provide custome exception handler function for the loop.

--
components: asyncio
messages: 372934
nosy: asvetlov, tomaszdrozdz, yselivanov
priority: normal
severity: normal
status: open
title: Allo to provide custom exception handler to asyncio.run()
type: enhancement
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue41202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com