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
On this page
Latest version 3.1.6, released March 5, 2025. Source repository
Packages on PyPI run on Python. Python end of life dates.
jinja2 3.1.5 breaking changes
- Removed
jinja2.filters.SandboxedEnvironment.format_string
SandboxedEnvironment.format_string was removed in Jinja2 3.1.5 pypi.org - Removed
jinja2.sandbox.inspect_format_method
jinja2.sandbox.inspect_format_method was removed in Jinja2 3.1.5 pypi.org - 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 - 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 - Signature changed
jinja2.ChainableUndefined.__getattr__
Was def __getattr__(self, _: str) -> ChainableUndefined; now def __getattr__(self, name: str) -> ChainableUndefined. pypi.org - Signature changed
jinja2.ChainableUndefined.__getitem__
Was __getitem__; now def __getitem__(self, _name: str) -> ChainableUndefined. pypi.org - Signature changed
jinja2.compiler.Frame.copy
Was def copy(self) -> Frame; now def copy(self) -> te.Self. pypi.org - Signature changed
jinja2.compiler.Frame.soft
Was def soft(self) -> Frame; now def soft(self) -> te.Self. pypi.org - Signature changed
jinja2.compiler.Symbols.copy
Was def copy(self) -> Symbols; now def copy(self) -> te.Self. pypi.org - Signature changed
jinja2.environment.Extension.bind
Was def bind(self, environment: Environment) -> Extension; now def bind(self, environment: Environment) -> te.Self. pypi.org - Signature changed
jinja2.environment.LRUCache.copy
Was def copy(self) -> LRUCache; now def copy(self) -> te.Self. pypi.org - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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
jinja2 3.1.4 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 - 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 - 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 - 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 - 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 - 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 - Signature changed
jinja2.environment.LRUCache.__getnewargs__
Was def __getnewargs__(self) -> t.Tuple; now def __getnewargs__(self) -> t.Tuple[t.Any, ...]. pypi.org - 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 - 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 - 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
And 19 more in this version. Sign up to see every change
jinja2 3.0.0 breaking changes
- Removed
jinja2.asyncfilters
jinja2.asyncfilters was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.asyncsupport
jinja2.asyncsupport was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.bccache.BytesIO
jinja2.bccache.BytesIO was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.bccache.marshal_dump
jinja2.bccache.marshal_dump was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.bccache.marshal_load
jinja2.bccache.marshal_load was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.bccache.open_if_exists
jinja2.bccache.open_if_exists was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.bccache.pickle
jinja2.bccache.pickle was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.bccache.text_type
jinja2.bccache.text_type was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.compiler.code_features
jinja2.compiler.code_features was removed in Jinja2 3.0.0 pypi.org - Removed
jinja2.compiler.CodeGenerator.binop
CodeGenerator.binop was removed in Jinja2 3.0.0 pypi.org
And 173 more in this version. Sign up to see every change
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The 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.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.