bpo-37022: Fix bug where `pdb`'s `do_p`/`do_pp` commands swallow exceptions from `repr` by blueyed ยท Pull Request #18180 ยท python/cpython

@blueyed

@blueyed

@blueyed

@blurb-it

iritkatriel

try:
val = self._getval(arg)
except:
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth a comment that getval already emitted an error

@gvanrossum

This looks to me like a bugfix and seems safe to backport to 3.9 and 3.8. Clearly the intention was to just catch the exception from _getval() and that it caught something else would be an unfortunate side effect, not something someone would rely on.

iritkatriel

@iritkatriel

iritkatriel

@bedevere-bot

๐Ÿค– New build scheduled with the buildbot fleet by @iritkatriel for commit 084d10b ๐Ÿค–

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@iritkatriel iritkatriel changed the title bpo-37022: pdb: do not swallow exceptions from repr with do_p/do_pp bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr

Jun 10, 2021

@gvanrossum

Irit, you can manage this by yourself, right?

@iritkatriel

Irit, you can manage this by yourself, right?

Yes. Just waiting for the bot to finish.

@miss-islington

Thanks @blueyed for the PR, and @iritkatriel for merging it ๐ŸŒฎ๐ŸŽ‰.. I'm working now to backport this PR to: 3.10, 3.9.
๐Ÿ๐Ÿ’โ›๐Ÿค–

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jun 10, 2021
โ€ฆ from repr (pythonGH-18180)

(cherry picked from commit 6544b25)

Co-authored-by: Daniel Hahler <git@thequod.de>

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jun 10, 2021
โ€ฆ from repr (pythonGH-18180)

(cherry picked from commit 6544b25)

Co-authored-by: Daniel Hahler <git@thequod.de>

iritkatriel pushed a commit that referenced this pull request

Jun 10, 2021
โ€ฆ from repr (GH-18180) (GH-26650)

(cherry picked from commit 6544b25)

Co-authored-by: Daniel Hahler <git@thequod.de>

iritkatriel pushed a commit that referenced this pull request

Jun 10, 2021
โ€ฆ from repr (GH-18180) (GH-26651)

(cherry picked from commit 6544b25)

Co-authored-by: Daniel Hahler <git@thequod.de>