Skip to content

pdbpp: Pdb.set_trace() got an unexpected keyword argument 'commands' #133914

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
hugovk opened this issue May 12, 2025 · 2 comments
Closed

pdbpp: Pdb.set_trace() got an unexpected keyword argument 'commands' #133914

hugovk opened this issue May 12, 2025 · 2 comments
Labels
3.14 bugs and security fixes 3.15 new features, bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@hugovk
Copy link
Member

hugovk commented May 12, 2025

Bug report

Bug description:

a = 1
print(a)
breakpoint()
a = 2
print(a)

Works fine with pdb:

python3.14 --version
Python 3.14.0b1python3.14 1.py
1
> /private/tmp/1.py(3)<module>()
-> breakpoint()
(Pdb)

However, after installing pdbpp 0.11.6 (which has recently been forked and resurrected):

❯ python3.14 1.py
1
Traceback (most recent call last):
  File "/private/tmp/1.py", line 3, in <module>
    breakpoint()
    ~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pdb.py", line 2655, in set_trace
    pdb.set_trace(sys._getframe().f_back, commands=commands)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Pdb.set_trace() got an unexpected keyword argument 'commands'

(Python 3.13 works as expected.)

This is because the commands argument has been added in 3.14:

https://docs.python.org/3.14/library/pdb.html#pdb.set_trace

And it's likely that pdbpp has subclassed Pdb and doesn't yet support commands.

@gaogaotiantian Is this something that pdb or pdbpp should fix?

I've not tested other debuggers.

CPython versions tested on:

3.14

Operating systems tested on:

macOS

@hugovk hugovk added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir 3.14 bugs and security fixes 3.15 new features, bugs and security fixes labels May 12, 2025
@gaogaotiantian
Copy link
Member

I think they already fixed it a few days ago.

This is something pdbpp should fix, because they actually hacked pdb so pdb.set_trace can point to their code, instead of real pdb. If you are monkey patching the standard library, it's your responsibility to sync everything. I believe they did it to make pdbpp a "drop in replacement" - that after installing the package (and probably importing it) you don't need to do anything special to bring it up.

However, for a normal derived debugger, they should not rely on pdb.set_trace to bring up their debugger, and they should be able to control everything. This new feature itself should not break any code unless they are doing something shady.

@hugovk
Copy link
Member Author

hugovk commented May 13, 2025

Thanks, and I see they've fixed it in bretello/pdbpp#43 👍

@hugovk hugovk closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 bugs and security fixes 3.15 new features, bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants