Skip to content

TypeError on where command with Python 3.14 (Pdb.print_stack_trace() signature mismatch) #64

@bityob

Description

@bityob

Hey,

I'm getting the following error when running the where (w) command under Python 3.14:

TypeError: Pdb.print_stack_trace() takes 1 positional argument but 2 were given

This happens only on Python 3.14 — everything works fine with Python 3.13.9.

Minimal reproduction

# pdbpp_issue.py
print("hello world")

Run with Python 3.14:

[2] > /private/tmp/pdbpp_issue.py(1)<module>()
-> print("hello world")
(Pdb++) w
Traceback (most recent call last):
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/pdb.py", line 3601, in main
    pdb._run(target)
    ~~~~~~~~^^^^^^^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/pdb.py", line 2522, in _run
    self.run(target.code)
    ~~~~~~~~^^^^^^^^^^^^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/bdb.py", line 899, in run
    exec(cmd, globals, locals)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
  File "/private/tmp/pdbpp_issue.py", line 1, in <module>
    print("hello world")
    ^^^^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/bdb.py", line 94, in wrapper
    ret = func(frame, *args)
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/bdb.py", line 130, in line_callback
    frame.f_trace(frame, 'line', None)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/bdb.py", line 284, in trace_dispatch
    return self.dispatch_line(frame)
           ~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/bdb.py", line 310, in dispatch_line
    self.user_line(frame)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/pdb.py", line 547, in user_line
    self.interaction(frame, None)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/bityob/.cache/uv/archive-v0/5EUa02FNRSk9D-sl4qXmF/lib/python3.14/site-packages/pdbpp.py", line 449, in interaction
    return self._interaction(frame, tb)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/bityob/.cache/uv/archive-v0/5EUa02FNRSk9D-sl4qXmF/lib/python3.14/site-packages/pdbpp.py", line 483, in _interaction
    self._cmdloop()
    ~~~~~~~~~~~~~^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/pdb.py", line 601, in _cmdloop
    self.cmdloop()
    ~~~~~~~~~~~~^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/cmd.py", line 149, in cmdloop
    stop = self.onecmd(line)
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/pdb.py", line 1038, in onecmd
    return cmd.Cmd.onecmd(self, line)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/cmd.py", line 227, in onecmd
    return func(arg)
  File "/Users/bityob/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/pdb.py", line 1689, in do_where
    self.print_stack_trace(count)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
TypeError: Pdb.print_stack_trace() takes 1 positional argument but 2 were given

Run with Python 3.13.9 (works as expected):

$ uv run --python 3.13.9 --with pdbpp python -m pdb pdbpp_issue.py
[2] > /private/tmp/pdbpp_issue.py(1)<module>()
-> print("hello world")
(Pdb++) w
  [0] .../bdb.py(666)run()
      exec(cmd, globals, locals)
  [1] <string>(1)<module>()
> [2] /private/tmp/pdbpp_issue.py(1)<module>()
      print("hello world")

I haven’t had time to dig into it yet, but wanted to report it here so it’s on the radar for future investigation and potential fixes.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions