Skip to content

Drop deprecation warnings on the templating module#3118

Merged
Kludex merged 1 commit intomainfrom
drop-warnings-in-templating
Jan 24, 2026
Merged

Drop deprecation warnings on the templating module#3118
Kludex merged 1 commit intomainfrom
drop-warnings-in-templating

Conversation

@Kludex
Copy link
Owner

@Kludex Kludex commented Jan 24, 2026

No description provided.

@Kludex Kludex enabled auto-merge (squash) January 24, 2026 09:40
@Kludex Kludex merged commit 96479da into main Jan 24, 2026
6 checks passed
@Kludex Kludex deleted the drop-warnings-in-templating branch January 24, 2026 09:41
sentrivana added a commit to getsentry/sentry-python that referenced this pull request Feb 24, 2026
…5525)

## Summary

- Fix `test_template_tracing_meta` failure on `starlette==1.0.0rc1`
across all Python versions (3.10, 3.13, 3.14, 3.14t)

Closes #5523

## Analysis

Starlette 1.0.0rc1 removed the deprecated `TemplateResponse(name,
context)` calling convention
([Kludex/starlette#3118](Kludex/starlette#3118),
commit [`96479da`](Kludex/starlette@96479da)).
The new required signature is `TemplateResponse(request, name,
context)`.

When the old-style call was made, the string template name was passed as
the `request` parameter and the context dict as `name`, which then got
used as part of a Jinja2 cache key tuple, causing `TypeError: unhashable
type: 'dict'`.

The fix branches on `STARLETTE_VERSION >= (1,)` to use the new API for
Starlette 1.0+ while keeping the old API for older versions.

## Test plan

- [x] `tox -e py3.14-starlette-v1.0.0rc1` — 71 passed
- [x] `tox -e py3.14-starlette-v0.52.1` — 71 passed (no regression)
- [ ] CI passes on all Web 1 jobs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant