gh-140456: Clarify traceback source line documentation#153469
Open
harjothkhara wants to merge 2 commits into
Open
gh-140456: Clarify traceback source line documentation#153469harjothkhara wants to merge 2 commits into
harjothkhara wants to merge 2 commits into
Conversation
Documentation build overview
|
6202ef6 to
5bc4855
Compare
5bc4855 to
67bab37
Compare
Column position information alone is not enough: end_lineno defaults to lineno, so a frame with colno/end_colno but no end_lineno still shows only its first physical line. Say so, and test it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
traceback.format_list()stopped printing every line when a frame'slineholds more than one physical line. On the issue, serhiy-storchaka pointed out thatlinewas never meant to hold more than one line, so this documents the real contract instead of changing behavior.Updates the docs and the matching docstrings for
format_list(),StackSummary.from_list(),StackSummary.format()andFrameSummary.line. A frame only shows all of its lines when it has column position information and an end line number past its own line number — column info by itself isn't enough, sinceend_linenodefaults tolineno.Adds tests for old-style tuples and for
FrameSummarywith column info, without it, and with column info but noend_lineno.No behavior change —
Lib/traceback.pyis docstrings only. Docs and tests, so no NEWS entry.I used AI assistance for this and have reviewed the change.
traceback.format_list()breaking behavior change. #140456