Issue 32679: concurrent.futures should store full sys.exc_info() (original) (raw)

Created on 2018-01-26 14:23 by jonash, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg310762 - (view) Author: Jonas H. (jonash) * Date: 2018-01-26 14:23
Use case: Try to get a future's result using concurrent.futures.Future.result(), and log the full exception if there was any. Currently, only "excinst" (sys.exc_info()[1]) is provided with the Future.exception() method. Proposal: Add new Future.exc_info() method that returns the full sys.exc_info() at the time of the exception.
msg310763 - (view) Author: Jonas H. (jonash) * Date: 2018-01-26 14:24
See also https://stackoverflow.com/questions/19309514/getting-original-line-number-for-exception-in-concurrent-futures for other people having the same problem
msg341982 - (view) Author: Brian Quinlan (bquinlan) * (Python committer) Date: 2019-05-09 14:58
My understanding is that tracebacks have a pretty large memory profile so I'd rather not keep them alive. Correct me if I'm wrong about that.
msg406064 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-11-09 23:03
The SO link seems to refer to Python 2, but on this issue the version are Python 3. In Python 3 the traceback is accessible from the exception via its __traceback__ attribute. Does that not give you what you need?
msg410244 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-10 19:04
Following the changes in , exc_info[2] is exactly the same as exc_info[1].__traceback__, so there is no point in making this change now.
History
Date User Action Args
2022-04-11 14:58:57 admin set github: 76860
2022-01-10 19:04:18 iritkatriel set status: open -> closedresolution: not a bugmessages: + stage: resolved
2021-11-09 23:03:12 iritkatriel set nosy: + iritkatrielmessages: +
2019-05-09 14:58:18 bquinlan set messages: +
2019-03-21 23:35:40 cheryl.sabella set nosy: + bquinlan, pitrouversions: - Python 3.4, Python 3.5, Python 3.6
2018-01-26 14:24:10 jonash set messages: +
2018-01-26 14:23:29 jonash create