Repository navigation
fix: treat oversized list indices as missing placeholder segments - #93
Open
atishay-kasliwal wants to merge 1 commit into
Open
atishay-kasliwal wants to merge 1 commit into
atishay-kasliwal wants to merge 1 commit into
Conversation
An all-decimal segment longer than Python's integer-string conversion limit passed the isdecimal() check and then raised ValueError from int(), bypassing both the <path> marker and default(...). Fixes intuit#91 Signed-off-by: Atishay Kasliwal <katishay@gmail.com>
atishay-kasliwal
requested review from
Bbenchaya,
ChiefArchitect and
sboorlagadda
as code owners
November 4, 2026 14:38
This branch has not been deployed
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.
Checklist
[Unreleased]changelog entry for a user-visible change, or confirmed the change is exempt.Description
An all-decimal path segment longer than Python's integer-string conversion limit passes the
isdecimal()check from #76, then raisesValueErrorfromint(). The exception skips both the<path>marker anddefault(...)._lookup_pathnow gets the index from a small_parse_indexhelper, which returnsNonefor a segment that isn't a usable index, including oneint()refuses. That takes the existing unresolved path, so the marker anddefault(...)work as they do for any other missing segment. The conversion limit itself isn't touched.Tests cover
inputandconfig, with and without a default, on lists and tuples, plus normal indices and a Unicode decimal digit. The oversized index ismax(sys.get_int_max_str_digits(), 4300) + 1digits long, so the test holds under any configured limit. With the limit disabled the index converts and is out of range, which gives the same result.Verified with
uv run pytest(538 passed),ruff check,ruff format --checkandmypy src/.tests/test_resolving.pyalso passes withPYTHONINTMAXSTRDIGITS=640and=0. Reverting theresolving.pychange makes the new list and tuple cases fail.Fixes #91