fix: Avoid infinite loop when cross-reference keyspace is exhausted#334
Open
jonashaag wants to merge 3 commits into
Open
fix: Avoid infinite loop when cross-reference keyspace is exhausted#334jonashaag wants to merge 3 commits into
jonashaag wants to merge 3 commits into
Conversation
jonashaag
marked this pull request as draft
July 18, 2026 18:08
Author
|
CI follow-up: the unrelated matrix failures are fixed in separate commits. Snapshot fixtures are checked out with LF on Windows; the docs inventory is only consumed by highest-resolution jobs; the global PyO3 ABI3 override was removed so current Pydantic builds on Python 3.15; and lowest-direct is limited to Python 3.10–3.13 because the minimum Pydantic stack cannot build on 3.14/3.15. The latest run is 31/31 green: https://github.com/mkdocstrings/python/actions/runs/29655904249 |
jonashaag
marked this pull request as ready for review
July 18, 2026 18:48
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.
Full disclosure: Written by GPT 5.6 Sol.
This fixes a problem with our docs build.
Cross-reference stash keys start with
_and preserve the rendered identifier length. One-character and two-character identifiers therefore share a keyspace of only 62 keys. Once all keys are present,_gen_stash_keyretries random choices forever.This became reproducible for attribute values after 2.0.5 started rendering their source-level names: a large value containing more than 62 references through the same one-character module alias hangs the documentation build.
Detect an exhausted key length and expand subsequent keys by one character. Non-exhausted keyspaces retain the existing same-length behavior.
Validation: