---
title: "jinja2 3.1.5 Breaking Changes on PyPI | Since.dev"
description: "What each jinja2 release removed, renamed or changed: 231 breaking changes in 3 versions on PyPI, each with its source."
canonical_url: https://since.dev/packages/pypi/jinja2
last_updated: 2026-12-04
---

# jinja2 breaking changes

jinja2 3.1.5 (December 21, 2024) is its newest release with breaking changes, 19 of them. The first: Removed jinja2.filters.SandboxedEnvironment.format_string. Every breaking API change we have recorded in jinja2 on PyPI: 231 breaking changes in 3 versions. Below, its 3 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `3.1.6`, released March 5, 2025. [Source repository](https://github.com/pallets/jinja)

Packages on PyPI run on Python. [Python end of life dates](https://since.dev/calendar/python.md).

- From [3.0.0](#v-3-0-0) to [3.1.5](#v-3-1-5): 48 breaking changes in 2 versions.

## jinja2 3.1.5 breaking changes

jinja2 3.1.5, released December 21, 2024: 19 breaking changes.

- **Removed** `jinja2.filters.SandboxedEnvironment.format_string`  

SandboxedEnvironment.format_string was removed in Jinja2 3.1.5 [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Removed** `jinja2.sandbox.inspect_format_method`  

jinja2.sandbox.inspect_format_method was removed in Jinja2 3.1.5 [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Behavior changed**  

The sandboxed environment no longer allows calling clear and pop on known mutable sequence types. Code in the sandbox that relies on these methods will need another approach. [github.com](https://github.com/pallets/jinja/releases/tag/3.1.5)
- **Signature changed** `jinja2.async_utils.auto_aiter`  

Was async def auto_aiter(iterable: t.Union\[t.AsyncIterable\[V\], t.Iterable\[V\]\]) -> t.AsyncIterator\[V\]; now def auto_aiter(iterable: t.Union\[t.AsyncIterable\[V\], t.Iterable\[V\]\]) -> t.AsyncIterator\[V\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.ChainableUndefined.__getattr__`  

Was def \_\_getattr\_\_(self, \_: str) -> ChainableUndefined; now def \_\_getattr\_\_(self, name: str) -> ChainableUndefined. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.ChainableUndefined.__getitem__`  

Was \_\_getitem\_\_; now def \_\_getitem\_\_(self, \_name: str) -> ChainableUndefined. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.compiler.Frame.copy`  

Was def copy(self) -> Frame; now def copy(self) -> te.Self. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.compiler.Frame.soft`  

Was def soft(self) -> Frame; now def soft(self) -> te.Self. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.compiler.Symbols.copy`  

Was def copy(self) -> Symbols; now def copy(self) -> te.Self. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.environment.Extension.bind`  

Was def bind(self, environment: Environment) -> Extension; now def bind(self, environment: Environment) -> te.Self. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.environment.LRUCache.copy`  

Was def copy(self) -> LRUCache; now def copy(self) -> te.Self. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.Environment.overlay`  

Was def overlay(self, block_start_string: str = missing, block_end_string: str = missing, variable_start_string: str = missing, variable_end_string: str = missing, comment_start_string: str = missing, comment_end_string: str = missing... [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.environment.Parser.parse_primary`  

Was def parse_primary(self) -> nodes.Expr; now def parse_primary(self, with_namespace: bool = False) -> nodes.Expr. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.environment.Parser.parse_tuple`  

Was def parse_tuple(self, simplified: bool = False, with_condexpr: bool = True, extra_end_rules: t.Optional\[t.Tuple\[str, ...\]\] = None, explicit_parentheses: bool = False) -> t.Union\[nodes.Tuple, nodes.Expr\]; now def parse_tuple(self... [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.filters.auto_aiter`  

Was async def auto_aiter(iterable: t.Union\[t.AsyncIterable\[V\], t.Iterable\[V\]\]) -> t.AsyncIterator\[V\]; now def auto_aiter(iterable: t.Union\[t.AsyncIterable\[V\], t.Iterable\[V\]\]) -> t.AsyncIterator\[V\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.filters.do_unique`  

Was def do_unique(environment: Environment, value: t.Iterable\[V\], case_sensitive: bool = False, attribute: t.Optional\[t.Union\[str, int\]\] = None) -> t.Iterator\[V\]; now async def do_unique(environment: Environment, value... [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.lexer.Failure.__call__`  

Was def \_\_call\_\_(self, lineno: int, filename: str) -> te.NoReturn; now def \_\_call\_\_(self, lineno: int, filename: t.Optional\[str\]) -> te.NoReturn. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.runtime.auto_aiter`  

Was async def auto_aiter(iterable: t.Union\[t.AsyncIterable\[V\], t.Iterable\[V\]\]) -> t.AsyncIterator\[V\]; now def auto_aiter(iterable: t.Union\[t.AsyncIterable\[V\], t.Iterable\[V\]\]) -> t.AsyncIterator\[V\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)
- **Signature changed** `jinja2.Template.generate_async`  

Was async def generate_async(self, \*args: t.Any, \*\*kwargs: t.Any) -> t.AsyncIterator\[str\]; now async def generate_async(self, \*args: t.Any, \*\*kwargs: t.Any) -> t.AsyncGenerator\[str, object\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.5/)

## jinja2 3.1.4 breaking changes

jinja2 3.1.4, released May 5, 2024: 29 breaking changes.

- **Behavior changed** `xmlattr`  

The xmlattr filter now disallows keys containing a slash, greater-than sign or equals sign, in addition to spaces. Code that passes such keys must stop using them or validate keys before passing them in. [github.com](https://github.com/pallets/jinja/releases/tag/3.1.4)
- **Signature changed** `jinja2.debug.Context.call`  

Was def call(\_\_self, \_\_obj: t.Callable, \*args: t.Any, \*\*kwargs: t.Any) -> t.Union\[t.Any, Undefined\]; now def call(\_\_self, \_\_obj: t.Callable\[..., t.Any\], \*args: t.Any, \*\*kwargs: t.Any) -> t.Union\[t.Any, Undefined\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.Environment.compile_templates`  

Was def compile_templates(self, target: t.Union\[str, os.PathLike\], extensions: t.Optional\[t.Collection\[str\]\] = None, filter_func: t.Optional\[t.Callable\[\[str\], bool\]\] = None, zip: t.Optional\[str\] = 'deflated', log_function... [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.environment.copy_cache`  

Was def copy_cache(cache: t.Optional\[t.MutableMapping\]) -> t.Optional\[t.MutableMapping\[t.Tuple\[weakref.ref, str\], Template\]\]; now def copy_cache(cache: t.Optional\[t.MutableMapping\[t.Any, t.Any\]\]) ->... [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.environment.create_cache`  

Was def create_cache(size: int) -> t.Optional\[t.MutableMapping\[t.Tuple\[weakref.ref, str\], Template\]\]; now def create_cache(size: int) -> t.Optional\[t.MutableMapping\[t.Tuple\[weakref.ref\[t.Any\], str\], Template\]\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.environment.Environment.compile_templates`  

Was def compile_templates(self, target: t.Union\[str, os.PathLike\], extensions: t.Optional\[t.Collection\[str\]\] = None, filter_func: t.Optional\[t.Callable\[\[str\], bool\]\] = None, zip: t.Optional\[str\] = 'deflated', log_function... [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.environment.LRUCache.__getnewargs__`  

Was def \_\_getnewargs\_\_(self) -> t.Tuple; now def \_\_getnewargs\_\_(self) -> t.Tuple\[t.Any, ...\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.environment.Parser.parse_call_args`  

Was def parse_call_args(self) -> t.Tuple; now def parse_call_args(self) -> t.Tuple\[t.List\[nodes.Expr\], t.List\[nodes.Keyword\], t.Optional\[nodes.Expr\], t.Optional\[nodes.Expr\]\]. [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.environment.TemplateStream.dump`  

Was def dump(self, fp: t.Union\[str, t.IO\], encoding: t.Optional\[str\] = None, errors: t.Optional\[str\] = 'strict') -> None; now def dump(self, fp: t.Union\[str, t.IO\[bytes\]\], encoding: t.Optional\[str\] = None, errors: t.Optional\[str\] =... [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)
- **Signature changed** `jinja2.FileSystemLoader.__init__`  

Was def \_\_init\_\_(self, searchpath: t.Union\[str, os.PathLike, t.Sequence\[t.Union\[str, os.PathLike\]\]\], encoding: str = 'utf-8', followlinks: bool = False) -> None; now def \_\_init\_\_(self, searchpath: t.Union\[str, os.PathLike\[str\]... [pypi.org](https://pypi.org/project/Jinja2/3.1.4/)

And 19 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## jinja2 3.0.0 breaking changes

jinja2 3.0.0, released May 11, 2021: 183 breaking changes.

- **Removed** `jinja2.asyncfilters`  

jinja2.asyncfilters was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.asyncsupport`  

jinja2.asyncsupport was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.bccache.BytesIO`  

jinja2.bccache.BytesIO was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.bccache.marshal_dump`  

jinja2.bccache.marshal_dump was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.bccache.marshal_load`  

jinja2.bccache.marshal_load was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.bccache.open_if_exists`  

jinja2.bccache.open_if_exists was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.bccache.pickle`  

jinja2.bccache.pickle was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.bccache.text_type`  

jinja2.bccache.text_type was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.compiler.code_features`  

jinja2.compiler.code_features was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)
- **Removed** `jinja2.compiler.CodeGenerator.binop`  

CodeGenerator.binop was removed in Jinja2 3.0.0 [pypi.org](https://pypi.org/project/Jinja2/3.0.0/)

And 173 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
