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: Add stacklevel support for exceptions
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, wyz23x2
Priority: normal Keywords:

Created on 2020-07-26 10:17 by wyz23x2, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg374308 - (view) Author: wyz23x2 (wyz23x2) * Date: 2020-07-26 10:17
Now warnings.warn supports a stacklevel parameter. But many users want exceptions to support it too.
Related:
https://stackoverflow.com/questions/34175111/raise-an-exception-from-a-higher-level-a-la-warnings
msg374310 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-07-26 10:23
warnings.warn(), the function which emits warnings, has the stacklevel parameter. But how do you provide stacklevel for exceptions?

See also bpo-39725.
History
Date User Action Args
2022-04-11 14:59:34adminsetgithub: 85571
2020-07-26 10:23:51serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg374310
2020-07-26 10:17:57wyz23x2create