Skip to content

gh-103225: Fixed zero lineno issue for pdb #103265

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

Merged
merged 3 commits into from
Apr 7, 2023

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Apr 5, 2023

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]

@arhadthedev arhadthedev added the stdlib Python modules in the Lib dir label Apr 5, 2023
@artemmukhin
Copy link
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 🙂

@gaogaotiantian
Copy link
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!

@gaogaotiantian
Copy link
Member Author

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

@iritkatriel
Copy link
Member

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

@gaogaotiantian
Copy link
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.

@iritkatriel
Copy link
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.

@gaogaotiantian
Copy link
Member Author

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

@iritkatriel
Copy link
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.

@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
Copy link
Member Author

@iritkatriel should we port this back to 3.11?

@iritkatriel
Copy link
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?

gaogaotiantian added a commit to gaogaotiantian/cpython that referenced this pull request May 7, 2023
@bedevere-bot
Copy link

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

@gaogaotiantian
Copy link
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.

iritkatriel pushed a commit that referenced this pull request May 7, 2023
gh-103225: Fixed zero lineno issue for pdb (#103265)

Co-authored-by: Artem Mukhin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants