This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: concurrent.futures should store full sys.exc_info()
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: bquinlan, iritkatriel, jonash, pitrou
Priority: normal Keywords:

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 issue45711, 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:57adminsetgithub: 76860
2022-01-10 19:04:18iritkatrielsetstatus: open -> closed
resolution: not a bug
messages: + msg410244

stage: resolved
2021-11-09 23:03:12iritkatrielsetnosy: + iritkatriel
messages: + msg406064
2019-05-09 14:58:18bquinlansetmessages: + msg341982
2019-03-21 23:35:40cheryl.sabellasetnosy: + bquinlan, pitrou

versions: - Python 3.4, Python 3.5, Python 3.6
2018-01-26 14:24:10jonashsetmessages: + msg310763
2018-01-26 14:23:29jonashcreate