When I run the (unchanged) script under Python 3.3 or 3.4 I get this:

deque([])
ERROR:asyncio:Future/Task exception was never retrieved
future: Future<exception=RuntimeError()>
Traceback (most recent call last):
  File "tb_bug.py", line 9, in task
    raise RuntimeError()
RuntimeError

That looks fine to me. Is that not what you see? What would you like to see?



On Thu, Feb 27, 2014 at 10:03 AM, Victor Stinner
<[email protected]>wrote:

> I forgot the script to reproduce the bug. I attached it to this email
> and to the issue: tb_bug.py.
>
> Victor
>
> 2014-02-27 19:02 GMT+01:00 Victor Stinner <[email protected]>:
> > Hi,
> >
> > I found some bugs with _TracebackLogger when loop.run_until_complete()
> is used:
> > http://code.google.com/p/tulip/issues/detail?id=155
> >
> > Try attached script to reproduce the issue with Tulip and Python 3.3.
> > You should get:
> > ---
> > deque([Handle(<bound method _TracebackLogger.activate of...>, ())])
> > ...
> >     [<asyncio.futures._TracebackLogger object at 0x7facadefb3f8>]
> >
> > ---
> >
> > The activate() method of the _TracebackLogger is never executed, the
> > _TracebackLogger is part of a reference cycle and cannot be collected
> > by the garbage collector, and the unhandled exception is not logged.
> >
> > If you uncommend "fut = None" in task(), you get:
> > ---
> > deque([Handle(<bound method _TracebackLogger.activate of
> > <asyncio.futures._TracebackLogger object at 0x7f9a98f8b3f8>>, ())])
> > ---
> >
> > The _TracebackLogger is collected, but the unhandled exception is
> > still not logged.
> >
> > In Python 3.4, it's better thanks to the PEP 442:
> > http://legacy.python.org/dev/peps/pep-0442/
> >
> > In Python 3.3, the problem is that _TracebackLogger contains an
> > exception which contains a traceback.
> >
> > For Trollius, it's also different because exception has no
> > __traceback__ attribute, and so the formatting of the traceback cannot
> > be deferred.
> >
> > So well, please take a look at my issue:
> > http://code.google.com/p/tulip/issues/detail?id=155
> >
> > Victor
>



-- 
--Guido van Rossum (python.org/~guido)

Reply via email to