On 2/6/2014, 5:46 PM, Victor Stinner wrote:
However, I'm not sure how passing the future/handle to the
handler may help.  You have the name of the failed callback
in the traceback of the exception.  And, in many places all
you have is just the failed callback function, and no
related future or task.
I'm talking about Future destructor which logs the unhandled exception. The
future is just self.

Do you know the new function tracemalloc.get_object_traceback()?

Saw it briefly in the what's new, but haven't had a chance
to try it myself yet (looking forward to!)

A question to you and Guido: should the callback receive
three arguments: loop, exception, and context, where
context is a namedtuple (so we can add new fields to it
in future releases). For now, 'context' can have two fields:
'message' and 'callback'. The former is the log message, and
the latter is the failed callback function (or None).

Another option is to have a loop method to get the current/last
executed callback.

What do you think?

Yury

Reply via email to