Skip to content

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

Not planned
@hugovk

Description

@hugovk

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

Activity

added
type-bugAn unexpected behavior, bug, or error
stdlibPython modules in the Lib dir
3.14bugs and security fixes
3.15new features, bugs and security fixes
on May 12, 2025
gaogaotiantian

gaogaotiantian commented on May 12, 2025

@gaogaotiantian
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

hugovk commented on May 13, 2025

@hugovk
MemberAuthor

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15new features, bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pdbpp: Pdb.set_trace() got an unexpected keyword argument 'commands' · Issue #133914 · python/cpython

      Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

      Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant