Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-103956: fix trace output in case of missing source line#103958
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
gh-103956: fix trace output in case of missing source line #103958
Uh oh!
There was an error while loading. Please reload this page.
Conversation
chgnrdv commented Apr 27, 2023 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
check if call to `linecache.getline` returns non-empty string otherwise print only filename with lineno
chgnrdv commented Apr 27, 2023
With this fix the output for frames with missing source files will look like this: |
serhiy-storchaka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add some tests?
chgnrdv commented Feb 10, 2024
It turned out that line tracing isn't tested at all. I will open a separate issue to handle it. |
serhiy-storchaka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @chgnrdv for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…ythonGH-103958) Print only filename with lineno if linecache.getline() returns an empty string. (cherry picked from commit 7c87ce7) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
…ythonGH-103958) Print only filename with lineno if linecache.getline() returns an empty string. (cherry picked from commit 7c87ce7) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
GH-118832 is a backport of this pull request to the 3.12 branch. |
GH-118833 is a backport of this pull request to the 3.11 branch. |
Thanks @chgnrdv for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…ythonGH-103958) Print only filename with lineno if linecache.getline() returns an empty string. (cherry picked from commit 7c87ce7) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
GH-118834 is a backport of this pull request to the 3.13 branch. |
serhiy-storchaka commented May 9, 2024
It is too late for the 3.11 backport, but it should now be backported to 3.13. |
…ythonGH-103958) Print only filename with lineno if linecache.getline() returns an empty string.
Fixes#103956
trace: line tracing output lacks newlines if source lines are not available #103956