Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1105)

Issue 64900043: Save the traceback where a Future/Task was created

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by haypo_gmail
Modified:
10 years, 2 months ago
Reviewers:
yselivanov, GvR
Visibility:
Public.

Description

Save the traceback where a Future/Task was created

Patch Set 1 #

Total comments: 2

Patch Set 2 : Now with unit tests, better output #

Patch Set 3 : #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -22 lines) Patch
M asyncio/futures.py View 1 2 5 chunks +41 lines, -20 lines 5 comments Download
M tests/test_base_events.py View 1 1 chunk +2 lines, -2 lines 0 comments Download
M tests/test_futures.py View 1 2 2 chunks +44 lines, -0 lines 0 comments Download

Messages

Total messages: 9
yselivanov
https://codereview.appspot.com/64900043/diff/1/asyncio/futures.py File asyncio/futures.py (right): https://codereview.appspot.com/64900043/diff/1/asyncio/futures.py#newcode199 asyncio/futures.py:199: '%s' I would make it more obvious how two ...
10 years, 2 months ago (2014-02-18 19:06:02 UTC) #1
haypo_gmail
https://codereview.appspot.com/64900043/diff/1/asyncio/futures.py File asyncio/futures.py (right): https://codereview.appspot.com/64900043/diff/1/asyncio/futures.py#newcode199 asyncio/futures.py:199: '%s' On 2014/02/18 19:06:02, yselivanov wrote: > I would ...
10 years, 2 months ago (2014-02-18 22:51:39 UTC) #2
GvR
This change is too late for 3.4.
10 years, 2 months ago (2014-02-20 00:59:20 UTC) #3
haypo_gmail
On 2014/02/20 00:59:20, GvR wrote: > This change is too late for 3.4. Oh :-( ...
10 years, 2 months ago (2014-02-20 01:13:32 UTC) #4
GvR
On 2014/02/20 01:13:32, haypo_gmail wrote: > On 2014/02/20 00:59:20, GvR wrote: > > This change ...
10 years, 2 months ago (2014-02-20 02:03:22 UTC) #5
yselivanov
Couple of notes, one is pretty major. https://codereview.appspot.com/64900043/diff/40001/asyncio/futures.py File asyncio/futures.py (right): https://codereview.appspot.com/64900043/diff/40001/asyncio/futures.py#newcode46 asyncio/futures.py:46: msg += ...
10 years, 2 months ago (2014-02-20 05:12:06 UTC) #6
haypo_gmail
https://codereview.appspot.com/64900043/diff/40001/asyncio/futures.py File asyncio/futures.py (right): https://codereview.appspot.com/64900043/diff/40001/asyncio/futures.py#newcode46 asyncio/futures.py:46: msg += ('\n' On 2014/02/20 05:12:06, yselivanov wrote: > ...
10 years, 2 months ago (2014-02-20 08:02:26 UTC) #7
haypo_gmail
2014-02-20 3:03 GMT+01:00 <gvanrossum@gmail.com>: > The set/get_debug() patch was an API change. But this patch ...
10 years, 2 months ago (2014-02-20 08:03:59 UTC) #8
yselivanov
10 years, 2 months ago (2014-02-20 16:06:49 UTC) #9
https://codereview.appspot.com/64900043/diff/40001/asyncio/futures.py
File asyncio/futures.py (right):

https://codereview.appspot.com/64900043/diff/40001/asyncio/futures.py#newcode205
asyncio/futures.py:205: _log_unhandled_exception(self, self._create_tb, exc_tb,
self._loop)
> I don't see how I could pass exception without logging it twice

Well, then rewrite your code.

Let the default exception handler do its job, and provide the second traceback
as an extra key in the context. We can modify 'default_exception_handler' to
print str objects in 'context' as is (not repr)

Exception objects are important. It's not just a formatted traceback -- its
__context__ and __cause__ chains, it's attributes (like OSError.errno), etc. So
omitting exception object from 'context' is *not* an option.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b