Skip to content

pdb CLI argument parsing errors with arguments to module targets #113548

Description

@vivster7

Bug report

Bug description:

The pdb CLI is no longer correctly forwarding arguments to other tools.

Example reproduction:

  • It raises an error pdb: error: argument pyfile: not allowed with argument -m
vscode ➜ ~ $ docker run -it --rm python:3.13.0a2 python -m pdb -m calendar 1
usage: pdb [-h] [-c command] (-m module | pyfile) [args ...]
pdb: error: argument pyfile: not allowed with argument -m

Expected behavior:

  • It starts the pdb debugger.
vscode ➜ ~ $ docker run -it --rm python:3.12 python -m pdb -m calendar 1
> /usr/local/lib/python3.12/calendar.py(1)<module>()
-> """Calendar printing functions
(Pdb) 

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions