yihong0618 ยท GitHub

Bug report

Bug description:

# normal breakpoint() quite in repl
Python 3.15.0a0 (heads/main:3e06cfcaee, Sep 15 2025, 08:36:03) [Clang 17.0.0 (clang-1700.0.13.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> breakpoint()
> <python-input-0>(1)<module>()
(Pdb) q
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    breakpoint()
    ~~~~~~~~~~^^
  File "/Users/hyi/prs/cpython/Lib/bdb.py", line 94, in wrapper
    ret = func(frame, *args)
  File "/Users/hyi/prs/cpython/Lib/bdb.py", line 154, in opcode_callback
    frame.f_trace(frame, 'opcode', None)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hyi/prs/cpython/Lib/bdb.py", line 289, in trace_dispatch
    return self.dispatch_opcode(frame, arg)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/hyi/prs/cpython/Lib/bdb.py", line 408, in dispatch_opcode
    if self.quitting: raise BdbQuit
                      ^^^^^^^^^^^^^
bdb.BdbQuit
# asyncio repl quit breakpoint
โžœ  cpython git:(hy/asyncio_repl_breakpoint) โœ— ./python.exe -m asyncio
asyncio REPL 3.15.0a0 (heads/main:3e06cfcaee, Sep 15 2025, 08:36:03) [Clang 17.0.0 (clang-1700.0.13.5)] on darwin
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> breakpoint(
... )
> <python-input-0>(1)<module>()
(Pdb) q
Quitting pdb will kill the process. Quit anyway? [y/n]

I checked the issues

refer issue #124703

and patch
#130395

in asyncio repl we do not for sure has ps1 in sys

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

Read the original on github.com โ†—