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.
Created on 2017年08月29日 07:45 by ncoghlan, last changed 2022年04月11日 14:58 by admin.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 26772 | closed | iritkatriel, 2021年06月17日 16:11 | |
| PR 28067 | merged | iritkatriel, 2021年08月30日 13:49 | |
| Messages (10) | |||
|---|---|---|---|
| msg300974 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2017年08月29日 07:45 | |
This is a proposed traceback module enhancement deriving from the "python -m" traceback verbosity discussion in issue 16217. Specifically, I'm thinking a good way of cleaning up those tracebacks would be to use `TracebackException.format()` to get the formatted exception output, but designate particular modules to be *skipped* during the iteration (specifically `runpy`, `_frozen_importlib`, `importlib`). I'm filing this as a separate issue so the discussion of the public API for the capability in the traceback module can be separated from the discussion of applying that API in runpy. |
|||
| msg301791 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2017年09月09日 20:32 | |
I think a more general facility to strip unwanted frames from traceback objects would be useful for more people (including importlib, I think). i.e. actually mutate the traceback object, not remove the unwanted frames when printing (since it only works if you're the one doing the printing). (note mutating a traceback object is very easy in C, it's just not possible in pure Python, except perhaps with nasty ctypes hacks) Also, the `ignore_modules` would be more powerful as a generic `filter` callback, I think. |
|||
| msg302892 - (view) | Author: Dmitry Kazakov (vaultah) * | Date: 2017年09月24日 22:51 | |
Yes, a public built-in facility to modify a traceback would certainly be useful, although there should be a standard way to "hide" unwanted frames without mutating the traceback, too, and the traceback module seems a perfect place to add it. I have no objections to the `filter` argument, though filtering out frames based on modules to me feels by far more common a task than anything else `filter` would be capable of. I can update the PR if there's a consensus that `filter` is favored over `ignore_modules`. |
|||
| msg304921 - (view) | Author: Dmitry Kazakov (vaultah) * | Date: 2017年10月24日 15:54 | |
Ping. (this issue needs a decision on ignore_modules vs filter callback, and/or patch review) |
|||
| msg305996 - (view) | Author: Dmitry Kazakov (vaultah) * | Date: 2017年11月09日 23:07 | |
I only recently realized that trace.Trace accepts two similar arguments, namely ignoremods and ignoredirs. Should we try to make the API and implementation of the functionality proposed here conform to that of trace.Trace's ignoremods? Would Python-Ideas be a more appropriate place to discuss this? |
|||
| msg306762 - (view) | Author: Pablo Galindo Salgado (pablogsal) * (Python committer) | Date: 2017年11月22日 23:48 | |
I have prepared a patch (attached) with a possible implementation of the C function that can filter traceback objects modifying the traceback chain. I can make a PR if the patch looks good enough to start iterating over it. In case an alternative implementation is needed I am more than happy to prepare another patch/PR. |
|||
| msg328137 - (view) | Author: Dmitry Kazakov (vaultah) * | Date: 2018年10月20日 14:02 | |
I asked for some input on this issue in January (https://mail.python.org/pipermail/python-dev/2018-January/151590.html). Since then an important PR was merged (https://github.com/python/cpython/pull/4793), however it mutates the traceback object. Should there be a way to hide frames while keeping the original traceback object intact? If not, this issue should probably be closed. Otherwise I would appreciate a review of the PR. |
|||
| msg334399 - (view) | Author: Dmitry Kazakov (vaultah) * | Date: 2019年01月26日 20:58 | |
It would seem no one is actually interested in this proposed enhancement. I'm closing my PR, since I'm not interested in resolving the file conflict. I'll probably submit a traceback-mutating patch to the issue 16217. This issue can be closed. |
|||
| msg382694 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2020年12月07日 23:01 | |
In issue42247 the unit test framework uses limit as a hack to remove its own frame, and then the traceback module applies the limit to the chained exception as well. If the filter suggested here existed, unit test could use that instead of limit. |
|||
| msg400777 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年08月31日 20:42 | |
New changeset 863154c9292e70c5a8a1a3f22ef4ee42e2304281 by Irit Katriel in branch 'main': bpo-31299: make it possible to filter out frames from tracebacks (GH-28067) https://github.com/python/cpython/commit/863154c9292e70c5a8a1a3f22ef4ee42e2304281 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:51 | admin | set | github: 75480 |
| 2021年08月31日 20:42:18 | iritkatriel | set | messages: + msg400777 |
| 2021年08月30日 13:49:41 | iritkatriel | set | pull_requests: + pull_request26511 |
| 2021年06月17日 16:11:46 | iritkatriel | set | pull_requests: + pull_request25358 |
| 2020年12月07日 23:02:15 | iritkatriel | set | versions: + Python 3.10, - Python 3.7 |
| 2020年12月07日 23:01:36 | iritkatriel | set | nosy:
+ iritkatriel messages: + msg382694 |
| 2019年01月26日 21:00:08 | vaultah | set | nosy:
- vaultah |
| 2019年01月26日 20:59:35 | vaultah | set | pull_requests: - pull_request11522 |
| 2019年01月26日 20:59:04 | vaultah | set | pull_requests: + pull_request11522 |
| 2019年01月26日 20:58:53 | vaultah | set | pull_requests: - pull_request5065 |
| 2019年01月26日 20:58:17 | vaultah | set | nosy:
brett.cannon, ncoghlan, pitrou, rbcollins, vaultah, pablogsal messages: + msg334399 |
| 2018年10月20日 14:10:00 | pablogsal | set | files: - traceback_filter.patch |
| 2018年10月20日 14:02:22 | vaultah | set | messages: + msg328137 |
| 2018年01月16日 23:48:56 | vaultah | set | stage: needs patch -> patch review pull_requests: + pull_request5065 |
| 2017年11月22日 23:48:29 | pablogsal | set | files:
+ traceback_filter.patch nosy: + pablogsal messages: + msg306762 keywords: + patch |
| 2017年11月22日 00:29:20 | vaultah | set | pull_requests: - pull_request3274 |
| 2017年11月09日 23:07:56 | vaultah | set | messages: + msg305996 |
| 2017年10月24日 15:54:13 | vaultah | set | messages: + msg304921 |
| 2017年09月24日 22:51:35 | vaultah | set | messages: + msg302892 |
| 2017年09月09日 20:32:57 | pitrou | set | nosy:
+ pitrou, brett.cannon messages: + msg301791 |
| 2017年08月29日 09:18:20 | vaultah | set | pull_requests: + pull_request3274 |
| 2017年08月29日 07:46:41 | ncoghlan | link | issue16217 dependencies |
| 2017年08月29日 07:45:45 | ncoghlan | create | |