Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pdb shows wrong line numbers for modules #103225

Copy link
Copy link
@artemmukhin

Description

@artemmukhin
Issue body actions

Bug report

  1. Create foo.py containing a = 1
  2. ./python -m pdb foo.py

Results in

./python -m pdb foo.py
./foo.py(1)<module>()
-> a = 1
(Pdb) longlist
  0     a = 1
(Pdb) 

The line number should be 1 instead of 0.

This occurs because the longlist command uses inspect.getsourcelines, which returns 0 as the starting line number for modules.

This bug was introduced in #101674.

Your environment

  • CPython versions tested on: main

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.