GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-103225: Fixed zero lineno issue for pdb by gaogaotiantian · Pull Request #103265 · python/cpython

Conversation

@gaogaotiantian

@gaogaotiantian gaogaotiantian commented Apr 5, 2023 •
edited by iritkatriel
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

According to #103225, inspect.getsourcelines() returns wrong line number. Fixing it it inspect will take extra discussion so we fixed it in pdb for now. If in the future this got fixed in inspect we can take the fix away.

Co-authored-by: Artem Mukhin [email protected]

  • Issue: pdb shows wrong line numbers for modules #103225

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added the awaiting review label Apr 5, 2023
@bedevere-bot bedevere-bot mentioned this pull request Apr 5, 2023
pdb shows wrong line numbers for modules #103225
Closed
@arhadthedev arhadthedev added the stdlib Standard Library Python modules in the Lib/ directory label Apr 5, 2023
@artemmukhin

artemmukhin commented Apr 5, 2023

Copy link
Copy Markdown
Contributor

Sure! Thank you for extracting the workaround and the test for pdb into a separate PR.

Regarding adding co-authors, this article might be helpful. But that is fine anyway 🙂

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian @artemmukhin
Fixed zero lineno issue for pdb
0b3c3b8
Co-authored-by: Artem Mukhin <[email protected]>
@gaogaotiantian
gaogaotiantian force-pushed the pdb-line-number branch from 73afc79 to 0b3c3b8 Compare April 5, 2023 16:00
@gaogaotiantian

gaogaotiantian commented Apr 5, 2023

Copy link
Copy Markdown
Member Author

Sure! Thank you for extracting the workaround and the test for pdb into a separate PR.

Regarding adding co-authors, this article might be helpful. But that is fine anyway 🙂

Thanks! That's helpful!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian

gaogaotiantian commented Apr 6, 2023

Copy link
Copy Markdown
Member Author

@iritkatriel could you take a look at this fix which originally was done in inspect #103226

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iritkatriel
iritkatriel reviewed Apr 6, 2023
View reviewed changes
Comment thread Lib/pdb.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

iritkatriel
iritkatriel reviewed Apr 6, 2023
View reviewed changes
Comment thread Lib/pdb.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

iritkatriel
iritkatriel reviewed Apr 6, 2023
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2023-04-05-01-28-53.gh-issue-103225.QD3JVU.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel

iritkatriel commented Apr 6, 2023

Copy link
Copy Markdown
Member

I've added the "co-authored by" line to the first comment.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian

gaogaotiantian commented Apr 6, 2023

Copy link
Copy Markdown
Member Author

I've added the "co-authored by" line to the first comment.

I redid the commit with co-authored-by so @ortem is showing as the co-author in the commit now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian @iritkatriel
Update Misc/NEWS.d/next/Library/2023-04-05-01-28-53.gh-issue-103225.Q…
b157545
…D3JVU.rst

Co-authored-by: Irit Katriel <[email protected]>
@iritkatriel

iritkatriel commented Apr 6, 2023

Copy link
Copy Markdown
Member

I’m not sure that would work, because we squash the commits when merging and typically remove the individual commit messages. It does get picked up from the description of the PR though.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian

gaogaotiantian commented Apr 6, 2023

Copy link
Copy Markdown
Member Author

Hmm, interesting to know that. Next time I'll do it in the PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian
Create a helper function for getsourcelines
e7dd1f6
@gaogaotiantian
gaogaotiantian requested a review from iritkatriel April 7, 2023 17:19
iritkatriel
iritkatriel approved these changes Apr 7, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Apr 7, 2023
@iritkatriel
iritkatriel merged commit 2667452 into python:main Apr 7, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Apr 7, 2023
@iritkatriel

iritkatriel commented Apr 7, 2023

Copy link
Copy Markdown
Member

Hmm, interesting to know that. Next time I'll do it in the PR.

Actually I think more accurately - GitHub probably picks up the coauthor from the commit message, but the person who merges typically deletes all the individual commit messages, and is more likely to notice the "co-authored by" in the main message and not erase it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian
gaogaotiantian deleted the pdb-line-number branch April 8, 2023 04:37
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@gaogaotiantian @warsaw
pythongh-103225: Fixed zero lineno issue for pdb (python#103265)
b119d39
Co-authored-by: Artem Mukhin <[email protected]>
@gaogaotiantian

gaogaotiantian commented May 5, 2023

Copy link
Copy Markdown
Member Author

@iritkatriel should we port this back to 3.11?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian gaogaotiantian mentioned this pull request May 5, 2023
pdb debugger command <ll> (longlist shows wrong current line in python versions 3.10, 3.11 #104207
Closed
@iritkatriel

iritkatriel commented May 6, 2023

Copy link
Copy Markdown
Member

@iritkatriel should we port this back to 3.11?

We could, if this bug is there as well. Could you check to make sure, and then make a PR for 3.11?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gaogaotiantian added a commit to gaogaotiantian/cpython that referenced this pull request May 7, 2023
@gaogaotiantian @artemmukhin
pythongh-103225: Fixed zero lineno issue for pdb (python#103265)
c1254e4
Co-authored-by: Artem Mukhin <[email protected]>
@bedevere-bot

bedevere-bot commented May 7, 2023

Copy link
Copy Markdown

GH-104262 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian

gaogaotiantian commented May 7, 2023

Copy link
Copy Markdown
Member Author

@iritkatriel should we port this back to 3.11?

We could, if this bug is there as well. Could you check to make sure, and then make a PR for 3.11?

Confirmed that 3.11 has this issue as well, PR was made.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel iritkatriel mentioned this pull request May 7, 2023
[3.11] gh-103225: Fixed zero lineno issue for pdb (#103265) #104262
Merged
iritkatriel pushed a commit that referenced this pull request May 7, 2023
@gaogaotiantian @artemmukhin
[3.11] gh-103225: Fixed zero lineno issue for pdb (#103265) (#104262)
19abf69
gh-103225: Fixed zero lineno issue for pdb (#103265)

Co-authored-by: Artem Mukhin <[email protected]>
@George-Ogden George-Ogden mentioned this pull request Jul 20, 2025
Fix Offset Bug George-Ogden/dbg#13
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes
+1 more reviewer
@artemmukhin artemmukhin artemmukhin left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

stdlib Standard Library Python modules in the Lib/ directory

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@gaogaotiantian @artemmukhin @iritkatriel @bedevere-bot @arhadthedev
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.