Skip to content

pdb's breakpoint should check if condition is a valid expression #103068

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

Closed
gaogaotiantian opened this issue Mar 28, 2023 · 2 comments
Closed

pdb's breakpoint should check if condition is a valid expression #103068

gaogaotiantian opened this issue Mar 28, 2023 · 2 comments
Labels
type-feature A feature request or enhancement

Comments

@gaogaotiantian
Copy link
Member

gaogaotiantian commented Mar 28, 2023

This could be either a bug report or a feature request. pdb has conditional breakpoint feature where you can set a condition for the breakpoint to be effective. You can also use condition command to change it.

The problem is - it never checks whether that condition is a valid expression. The expression will be evaluated when the breakpoint is hit and if there's a syntax error, it'll just consider it True. This is not an ideal behavior. We can warn the users if their input condition is not even a valid expression because under no circumstances that's the expected input. Also it would not be a valid command.

Linked PRs

@gaogaotiantian gaogaotiantian added the type-bug An unexpected behavior, bug, or error label Mar 28, 2023
@ambv ambv added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Mar 28, 2023
@ambv
Copy link
Contributor

ambv commented Mar 28, 2023

Since this is an equivalent of GH-103023, let's treat this as a new feature, too.

ambv added a commit that referenced this issue Mar 29, 2023
@ambv
Copy link
Contributor

ambv commented Mar 29, 2023

Landed for 3.12, thanks! ✨ 🍰 ✨

@ambv ambv closed this as completed Mar 29, 2023
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants