Skip to content

gh-135490: Add warning about arguments that conflict with pdb #135520

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SnoopJ
Copy link
Contributor

@SnoopJ SnoopJ commented Jun 14, 2025

Closes #135490.

This changeset adds a warning to the pdb docs explaining that target program arguments that overlap with pdb arguments must be separated from the rest of the command line by -- to prevent confusion on the part of argparse.

Should only be merged if a fix for that issue does not materialize, although the pdb target.py -- -m XYZ case is likely to apply even if there is a fix for the the repeated -m case.

Screenshot

Screenshot of proposed Python documentation


📚 Documentation preview 📚: https://cpython-previews--135520.org.readthedocs.build/

@@ -88,6 +88,15 @@ after normal exit of the program), pdb will restart the program. Automatic
restarting preserves pdb's state (such as breakpoints) and in most cases is more
useful than quitting the debugger upon program's exit.

.. warning::
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be a note, not a warning. Warnings are typically reserved for security problems and things along those lines.

@ZeroIntensity ZeroIntensity added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 14, 2025
@gaogaotiantian
Copy link
Member

I agree that this should be be a warning. However, let's hold it off until I figure out what we should do about the actual behavior, because -m might just work and we don't need to use it as an example to confuse users. -p does not start a script so it won't take any extra arguments and everything might just magically work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

pdb consumes arguments greedily
3 participants