Repository navigation
Conversation
akzarma
force-pushed
the
fix/devtools-debug-repr-fallback
branch
from
November 21, 2026 12:30
94e2c83 to
c88100f
Compare
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.
When pretty printing raises,
debug()falls back to callingrepr()on the value. If that also raises (for example, a repr that accesses a closed resource), the debugging call currently raises instead of returning the original object.Keep the normal repr fallback. If it raises, print
<unrepresentable value>with the type and the original pretty-printing diagnostic, then return the original object as usual.Validation: The focused regression failed before and passed after the change. The full pytest suite passed (154 passed, 1 skipped). Ruff lint and formatting checks and strict basedpyright passed.
Prepared and tested with AI assistance.
Summary by cubic
debug()no longer raises when both pretty printing andrepr()fail. It prints<unrepresentable value>with the object's type and the pretty-printing diagnostic, then returns the original object as before. Added a regression test for a value whosereprraises.Written for commit c88100f. Summary will update on new commits.