You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes that's a bug when pdb switched to argparse. I'll fix it but It would be in the next 3.13 release. In the meantime, you should be able to explicitly pass the argument to the script instead of pdb by ./python -m pdb -c continue -c quit -- test.py foo --bar
I have Python 3.14.0 on Windows 2025 Datacenter edition v24H2.
This python command fails: python -m pdb pacetool.py -pacetablescsv. Note the "-p" beginning of "-pacetablescsv". This seems to cause problems. The error this command gives is:
This command works. Note that no long option in this case begins with "-p": python -m pdb piecework.py -daily -test -adminemailonly
Python 3.14: Also note that "-p" (lowercase) is not part of the python -h or python --help-all screens but uppercase "-P" is.
These programs all worked fine on Python 3.11.9. These programs all work fine without "-m pdb". It's using pdb that's the issue. pdb seems to process command line options differently between Python 3.11.9 and Python 3.14.
Make a project dir with an environment. You can make a totally fake program with a fake parameter to test it. Make a program "test.py" that contains:
print("Hello world")
Activate your environment and now do: python -m pdb test.py -pacetablescsv
The culprit here is -pacetablescsv. The command line argument convention for Python is to use a single dash (-) as "short options", which means it should take one letter. In this specific case, your command is equivalent (from argparse's view) as
python -m pdb test.py -p acetablescsv
-p is used by pdb to attach to a process, that's where the conflict is.
I still believe that we can make this better. I need to think about it.
Activity
gaogaotiantian commentedon Oct 8, 2024
Yes that's a bug when
pdbswitched toargparse. I'll fix it but It would be in the next 3.13 release. In the meantime, you should be able to explicitly pass the argument to the script instead ofpdbby./python -m pdb -c continue -c quit -- test.py foo --bargh-125115: Pass unknown pdb command line args to script instead of faâĶ
pythongh-125115: Pass unknown pdb command line args to script insteadâĶ
gaogaotiantian commentedon Oct 15, 2024
Fixed in #125424
[3.13] gh-125115: Pass unknown pdb command line args to script insteaâĶ
pythongh-125115: Pass unknown pdb command line args to script insteadâĶ
bulrush15 commentedon Oct 28, 2025
This is still an problem in Python 3.14.0.
gaogaotiantian commentedon Oct 29, 2025
@bulrush15 could you give a repro? What command did not work for you? The command above works for me on 3.14 and 3.15.
bulrush15 commentedon Oct 29, 2025
I have Python 3.14.0 on Windows 2025 Datacenter edition v24H2.
This python command fails:
python -m pdb pacetool.py -pacetablescsv. Note the "-p" beginning of "-pacetablescsv". This seems to cause problems. The error this command gives is:This command works. Note that no long option in this case begins with "-p":
python -m pdb piecework.py -daily -test -adminemailonlyPython 3.14: Also note that "-p" (lowercase) is not part of the
python -horpython --help-allscreens but uppercase "-P" is.These programs all worked fine on Python 3.11.9. These programs all work fine without "-m pdb". It's using pdb that's the issue. pdb seems to process command line options differently between Python 3.11.9 and Python 3.14.
Make a project dir with an environment. You can make a totally fake program with a fake parameter to test it. Make a program "test.py" that contains:
Activate your environment and now do:
python -m pdb test.py -pacetablescsvgaogaotiantian commentedon Nov 3, 2025
The culprit here is
-pacetablescsv. The command line argument convention for Python is to use a single dash (-) as "short options", which means it should take one letter. In this specific case, your command is equivalent (fromargparse's view) as-pis used bypdbto attach to a process, that's where the conflict is.I still believe that we can make this better. I need to think about it.
gh-125115 : Refactor the pdb parsing issue so positional arguments caâĶ
[3.14] gh-125115 : Refactor the pdb parsing issue so positional argumâĶ
pythongh-125115 : Refactor the pdb parsing issue so positional argumeâĶ