Fixed #37257 -- Prevented spurious double-dot deprecation warnings. - #21747
Open
adamchainz wants to merge 1 commit into
Open
Fixed #37257 -- Prevented spurious double-dot deprecation warnings.#21747adamchainz wants to merge 1 commit into
adamchainz wants to merge 1 commit into
Conversation
The deprecation warning for double-dot variable lookups checked
`str(filter_expression.var)`, which for constants is the resolved literal
value rather than a lookup expression. Templates containing string,
translated, or numeric literals with two consecutive dots, such as
`{{ "a..b" }}` or `{{ 'a..b'|upper }}`, therefore emitted a spurious
`RemovedInDjango70Warning` even though no variable lookup was involved,
breaking test suites run with -W error and putting valid templates on
track to become hard errors in Django 7.0. The check now only fires when
the filter expression's variable is an actual Variable lookup.
Regression in 5d911f2.
adamchainz
force-pushed
the
ticket_37257
branch
from
August 8, 2026 21:34
1b18aaf to
4101aac
Compare
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.
Trac ticket number
ticket-37257
Branch description
The deprecation warning for double-dot variable lookups checked
str(filter_expression.var), which for constants is the resolved literal value rather than a lookup expression. Templates containing string, translated, or numeric literals with two consecutive dots, such as{{ "a..b" }}or{{ 'a..b'|upper }}, therefore emitted a spuriousRemovedInDjango70Warningeven though no variable lookup was involved, breaking test suites run with -W error and putting valid templates on track to become hard errors in Django 7.0. The check now only fires when the filter expression's variable is an actual Variable lookup.Regression in 5d911f2.
AI Assistance Disclosure (REQUIRED)
Claude 5 Fable did nearly all the work here, discovering the bug and writing the commit. I made minor edits. I agree with the report and approach.
Checklist
mainbranch.