gh-106670: Fix Pdb handling of chained Exceptions with no stacks.#108865
gh-106670: Fix Pdb handling of chained Exceptions with no stacks.#108865iritkatriel merged 12 commits into
Conversation
The introduction of chained exception in pythongh-106676 would sometime lead to File .../Lib/pdb.py", line 298, in setup self.curframe = self.stack[self.curindex][0] ~~~~~~~~~~^^^^^^^^^^^^^^^ IndexError: list index out of range This fixes that by filtering exceptions that that do not have a stack/traceback. Update tests to not use stack-less exceptions when testing another feature, and add an explicit test on how we handle stackless exceptions.
|
I can't add reviewers, can someone add I'm not sure this needs a news as it's a fix for something that was added a week ago. |
Sorry, something went wrong.
|
How do I reproduce the bug on pdb? |
Sorry, something went wrong.
Oh, yes, sure: |
Sorry, something went wrong.
2e6c7de to
3607006
Compare
September 4, 2023 17:09
|
Is there any meaningful case where the latest exception (the one passed into Here's what I thought:
However:
So, I think the better way to do it is:
It would be much clearer to the future maintainers that Thoughts @iritkatriel ? |
Sorry, something went wrong.
|
@gaogaotiantian I'll see what I can do, but it might probably be quite invasive to support exceptions w/o tb. I can maybe keep them but refuse to Note that |
Sorry, something went wrong.
|
Yes, I think it would be good if all exceptions were shown, and those without traceback would display that somehow (rather than erroring). |
Sorry, something went wrong.
Yes, as we can guarantee the default exception(latest one) is with traceback, we can simply decline all the access to the exceptions without tracebacks when the users do
|
Sorry, something went wrong.
|
Ok, what about the following ? in do_exceptions I print And on attempt to jump to it, it says: There is one caveat WRT testing, I can't properly test |
Sorry, something went wrong.
I added a private version of post-mortem that takes an instance so that I can use it in the test. |
Sorry, something went wrong.
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
… the next previous one with tb
|
thanks !
…On Wed, Sep 6, 2023 at 11:42 Irit Katriel ***@***.***> wrote:
Merged #108865 <#108865> into main.
—
Reply to this email directly, view it on GitHub
<#108865 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACR5TZLKHNFVV2YC73XJL3XZBAPBANCNFSM6AAAAAA4KEPKUQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sorry, something went wrong.
The introduction of chained exception in gh-106676 would sometime lead to
This fixes that by filtering exceptions that that do not have a stack/traceback. Update tests to not use stack-less exceptions when testing another feature, and add an explicit test on how we handle stackless exceptions.