-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pdb: do_p and do_pp swallow exceptions from __repr__ #81203
Comments
Given:
Possible patch - clumsy due to
|
Hi Daniel, this is indeed unexpected, I don't see how to have a better patch since the fact that _getval() raise an exception is used in do_source() and do_whatis(). Could you convert your patch as a PR and add a test? |
Thanks for the feedback. What do you think of refactoring the common block (also used in other places) into a method? + except: This could/should be done separately probably then, just want your opinion on it. This would also allow to customize/override it in a single place then (e.g. with pdbpp I am displaying tracebacks for errors, which is done via error() currently then). |
This part of the code is already used in three places and your patch would add two occurrences of of it, I think it would be great to put the part that print the exception in a private method, to avoid duplicating it all over the place. Doing this seems small enough to me that I think it could be done in the same PR to avoid the overhead of having two separates PRs. |
pdb
'sdo_p
/do_pp
commands swallow exceptions fromrepr
#18180Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: