Skip to content

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

Closed

Description

@tanloong

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

Activity

  1. 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`[/+] on Dec 11, 2023
  2. gaogaotiantian commented on Dec 11, 2023

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

  3. tanloong commented on Dec 11, 2023

    @tanloong
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions