[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread STINNER Victor

STINNER Victor added the comment:

I tried to reply to Guido on Rietveld but I got an HTTP error 500.

Guido wrote:
 LGTM.

Cool, I will commit my change to Tulip  Python.

 In the long run I think we'll need to revisit the decision to not catch
 BaseException in a few places. There are quite a few issues around these, if 
 the
 app *does* catch them and keeps going there may be some confused states.

There is at least another issue: #22429.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22601
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread STINNER Victor

STINNER Victor added the comment:

I pushed the commit to Tulip: changeset e610f1408243.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22601
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fb65b9ed8023 by Victor Stinner in branch '3.4':
Issue #22601: run_forever() now consumes BaseException of the temporary task
https://hg.python.org/cpython/rev/fb65b9ed8023

New changeset 8437e2bfe7a9 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #22601: run_forever() now consumes BaseException of the
https://hg.python.org/cpython/rev/8437e2bfe7a9

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22601
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22601
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-10 Thread STINNER Victor

New submission from STINNER Victor:

BaseEventLoop.run_forever() creates a temporary task when it gets a coroutine 
object. If the coroutine raises a base exception, it is stored in the temporary 
task (task.set_exception(exc)). run_forever() doesn't catch the exception, 
which is the expected behaviour.

The problem is that the temporary task still holds the exception, whereas the 
caller doesn't have access to this temporary task object. As a result, a 
warning is logger.

I propose to simply drop the exception from the task object (consume it). The 
call will get it anyway, it's not catched.

Attached patch implements this idea with a unit test.

--
components: asyncio
files: run_forever.patch
keywords: patch
messages: 228994
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: loop.run_forever() should consume exception of the temporary 
task
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36866/run_forever.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22601
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-10 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22601
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com