8000 Inconsistent current line indication if the script is edited after entering `pdb` · Issue #112952 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Inconsistent current line indication if the script is edited after entering pdb #112952

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
tanloong opened this issue Dec 11, 2023 · 2 comments
Closed
Labels
type-bug An unexpected behavior, bug, or error

Comments

@tanloong
Copy link
Contributor
tanloong commented Dec 11, 2023

Bug report

Bug description:

  1. create a for-loop.py
for i in range(10):
    breakpoint()
    print(i)
  1. run python for-loop.py, entering the pdb interface

  2. insert a line to for-loop.py after breakpoint()

for i in range(10):
    breakpoint()
    print("This is an inserted line.")
    print(i)
  1. run c in pdb and the inserted line will be shown as current line indicated by ->, but the actual current line to be executed is print(i).

  2. run c again. The print(i), instead of the inserted line, will be executed.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

@tanloong tanloong added the type-bug An unexpected behavior, bug, or error label Dec 11, 2023
@tanloong tanloong changed the title Inconsistent current line indication if the script is edited after entering pdb Inconsistent current line indication if the script is edited after entering pdb Dec 11, 2023
@gaogaotiantian
Copy link
Member

See #111051. There's no perfect solution for this but we should warn user. The PR #111052 has been sitting there for a while but I have not had the chance to grab a core dev for it :)

@tanloong
Copy link
Contributor Author
tanloong commented Dec 11, 2023

Thanks for replying! I will keep this repeated issue open to hopefully attract some core dev's attention to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants
0