Repository navigation
Conversation
Parsing " [a.b.c.d]\n[a.b.c]" raised "'OutOfOrderTableProxy' object has no attribute 'trivia'". The intermediate tables created for an indented header carry its indent, and Table.append copies that indent onto the item it just stored. When that key is now split out of order, the lookup returns an OutOfOrderTableProxy, which has no trivia. Skip the indent copy for the proxy; its parts keep their own indentation. Issue python-poetry#263 was the three-level form of this, which only stopped failing because the outermost super table has no indent.
Wkhanex
reviewed
Oct 16, 2026
Wkhanex
left a comment
There was a problem hiding this comment.
AI-assisted validation at d0484992a8bd on Python 3.12.14: I expanded the indentation case to spaces, a tab, and mixed space/tab indentation at depths 4–6, for both a table and an array of tables. Each input also had an intervening unrelated table and a value added through the reopened parent. All 18 combinations parsed and preserved the original text before mutation, and their serialized data after mutation matched tomllib. The 23 focused out-of-order tests passed.
The mutation check matters here because skipping proxy trivia must leave its component tables usable after the initial parse, as well as avoid the AttributeError. I did not find a discrepancy in those cases.
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.
Fixes #661.
Table.appendcopies the parent's indent onto the item it just stored, but when that key is split out of order the lookup returns anOutOfOrderTableProxy, which has no trivia. The fix skips the proxy, since its parts already keep their own indentation. #263 was the same crash one level up and only stopped happening because the outermost super table has no indent.