Repository navigation
Preserve template expression traceback errors - #1635
Merged
Merged
Conversation
EmilStenstrom
force-pushed
the
fix/better-traceback-errors-1597
branch
from
May 1, 2026 22:23
91b5359 to
593d89b
Compare
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
EmilStenstrom
force-pushed
the
fix/better-traceback-errors-1597
branch
from
May 1, 2026 22:33
593d89b to
554aac6
Compare
EmilStenstrom
marked this pull request as ready for review
May 1, 2026 22:34
EmilStenstrom
enabled auto-merge
May 1, 2026 22:35
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
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.
Summary
Fixes #1597.
When a multi-node template expression raised while Django template debug mode was enabled,
StringifiedNodecould become Django's culprit node without carrying the metadata Django expects for traceback annotation. That replaced the original rendering error with an unrelatedAttributeError.This preserves the wrapped node's template metadata, and falls back to the active render context origin when needed, so the original exception is surfaced.
Validation
uv run pytest tests/test_expression.py -quv run tox -e ruff,mypy