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

# flask breaking changes

flask 3.1.3 (February 19, 2026) is its newest release with breaking changes, 5 of them. The first: Removed flask.sessions.SecureCookieSession.\_\_getitem\_\_. Every breaking API change we have recorded in flask on PyPI: 315 breaking changes in 8 versions. Below, its 8 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `3.1.3`, released February 19, 2026. [Source repository](https://github.com/pallets/flask)

Its 3.1.0 release drops [Python 3.8](https://since.dev/calendar/python/3.8.md). [Python end of life dates](https://since.dev/calendar/python.md).

- From [2.0.0](#v-2-0-0) to [3.1.3](#v-3-1-3): 223 breaking changes in 6 versions.
- From [1.0](#v-1-0) to [3.1.3](#v-3-1-3): 284 breaking changes in 7 versions.

## flask 3.1.3 breaking changes

flask 3.1.3, released February 19, 2026: 5 breaking changes.

- **Removed** `flask.sessions.SecureCookieSession.__getitem__`  

SecureCookieSession.\_\_getitem\_\_ was removed in Flask 3.1.3 [pypi.org](https://pypi.org/project/Flask/3.1.3/)
- **Removed** `flask.sessions.SecureCookieSession.get`  

SecureCookieSession.get was removed in Flask 3.1.3 [pypi.org](https://pypi.org/project/Flask/3.1.3/)
- **Removed** `flask.sessions.SecureCookieSession.setdefault`  

SecureCookieSession.setdefault was removed in Flask 3.1.3 [pypi.org](https://pypi.org/project/Flask/3.1.3/)
- **Signature changed** `flask.app.RequestContext.session`  

Was session: SessionMixin | None; now session: SessionMixin. [pypi.org](https://pypi.org/project/Flask/3.1.3/)
- **Signature changed** `flask.sessions.SecureCookieSession.__init__`  

Was def \_\_init\_\_(self, initial: c.Mapping\[str, t.Any\] | c.Iterable\[tuple\[str, t.Any\]\] | None = None) -> None; now def \_\_init\_\_(self, initial: c.Mapping\[str, t.Any\] | None = None) -> None. [pypi.org](https://pypi.org/project/Flask/3.1.3/)

## flask 3.1.2 breaking changes

flask 3.1.2, released August 19, 2025: 1 breaking change.

- **Signature changed** `flask.send_file`  

Was def send_file(path_or_file: os.PathLike\[t.AnyStr\] | str | t.BinaryIO, mimetype: str | None = None, as_attachment: bool = False, download_name: str | None = None, conditional: bool = True, etag: bool | str = True, last_modified... [pypi.org](https://pypi.org/project/Flask/3.1.2/)

## flask 3.1.1 breaking changes

flask 3.1.1, released May 13, 2025: 1 breaking change.

- **Signature changed** `flask.app.FlaskCliRunner.invoke`  

Was def invoke(self, cli: t.Any = None, args: t.Any = None, \*\*kwargs: t.Any) -> t.Any; now def invoke(self, cli: t.Any = None, args: t.Any = None, \*\*kwargs: t.Any) -> Result. [pypi.org](https://pypi.org/project/Flask/3.1.1/)

## flask 3.1.0 breaking changes

flask 3.1.0, released November 13, 2024: 18 breaking changes.

- **Removed**  

Flask 3.1.0 no longer supports Python 3.8, so upgrade the interpreter before installing this release. [github.com](https://github.com/pallets/flask/releases/tag/3.1.0)
- **Behavior changed** `load_dotenv`  

When a path is passed, load_dotenv now also loads the default .env and .flaskenv files unless load_defaults=False is passed, and -e path takes precedence over them. [github.com](https://github.com/pallets/flask/releases/tag/3.1.0)
- **Behavior changed** `Request.trusted_hosts`  

Request.trusted_hosts is validated during routing and can be set through the TRUSTED_HOSTS config, so requests from untrusted hosts are handled differently. [github.com](https://github.com/pallets/flask/releases/tag/3.1.0)
- **Behavior changed** `SERVER_NAME`  

Setting SERVER_NAME no longer limits requests to only that domain when host_matching=True or subdomain_matching=False is set. [github.com](https://github.com/pallets/flask/releases/tag/3.1.0)
- **Configuration changed**  

Flask now requires Werkzeug 3.1 or later, ItsDangerous 2.2 or later and Blinker 1.9 or later, so older pinned versions must be upgraded. [github.com](https://github.com/pallets/flask/releases/tag/3.1.0)
- **Signature changed** `flask.Blueprint.open_resource`  

Was def open_resource(self, resource: str, mode: str = 'rb') -> t.IO\[t.AnyStr\]; now def open_resource(self, resource: str, mode: str = 'rb', encoding: str | None = 'utf-8') -> t.IO\[t.AnyStr\]. [pypi.org](https://pypi.org/project/Flask/3.1.0/)
- **Signature changed** `flask.cli.load_dotenv`  

Was def load_dotenv(path: str | os.PathLike\[str\] | None = None) -> bool; now def load_dotenv(path: str | os.PathLike\[str\] | None = None, load_defaults: bool = True) -> bool. [pypi.org](https://pypi.org/project/Flask/3.1.0/)
- **Signature changed** `flask.cli.ScriptInfo.__init__`  

Was def \_\_init\_\_(self, app_import_path: str | None = None, create_app: t.Callable\[..., Flask\] | None = None, set_debug_flag: bool = True) -> None; now def \_\_init\_\_(self, app_import_path: str | None = None, create_app: t.Callable\[... [pypi.org](https://pypi.org/project/Flask/3.1.0/)
- **Signature changed** `flask.ctx.SessionMixin`  

Was class SessionMixin(MutableMapping); now class SessionMixin(MutableMapping\[str, t.Any\]). [pypi.org](https://pypi.org/project/Flask/3.1.0/)
- **Signature changed** `flask.Flask.open_instance_resource`  

Was def open_instance_resource(self, resource: str, mode: str = 'rb') -> t.IO\[t.AnyStr\]; now def open_instance_resource(self, resource: str, mode: str = 'rb', encoding: str | None = 'utf-8') -> t.IO\[t.AnyStr\]. [pypi.org](https://pypi.org/project/Flask/3.1.0/)

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

## flask 3.0.1 breaking changes

flask 3.0.1, released January 18, 2024: 30 breaking changes.

- **Removed** `flask.json.provider.Response`  

flask.json.provider.Response was removed in Flask 3.0.1 [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.after_this_request`  

Was def after_this_request(f: ft.AfterRequestCallable) -> ft.AfterRequestCallable; now def after_this_request(f: ft.AfterRequestCallable\[t.Any\]) -> ft.AfterRequestCallable\[t.Any\]. [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.app.FlaskClient.session_transaction`  

Was def session_transaction(self, \*args: t.Any, \*\*kwargs: t.Any) -> t.Generator\[SessionMixin, None, None\]; now def session_transaction(self, \*args: t.Any, \*\*kwargs: t.Any) -> t.Iterator\[SessionMixin\]. [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.app.RequestContext.__init__`  

Was def \_\_init\_\_(self, app: Flask, environ: dict, request: Request | None = None, session: SessionMixin | None = None) -> None; now def \_\_init\_\_(self, app: Flask, environ: WSGIEnvironment, request: Request | None = None, session... [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.app.SessionInterface.get_cookie_samesite`  

Was def get_cookie_samesite(self, app: Flask) -> str; now def get_cookie_samesite(self, app: Flask) -> str | None. [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.cli.load_dotenv`  

Was def load_dotenv(path: str | os.PathLike | None = None) -> bool; now def load_dotenv(path: str | os.PathLike\[str\] | None = None) -> bool. [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.Config.__init__`  

Was def \_\_init\_\_(self, root_path: str | os.PathLike, defaults: dict | None = None) -> None; now def \_\_init\_\_(self, root_path: str | os.PathLike\[str\], defaults: dict\[str, t.Any\] | None = None) -> None. [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.config.ConfigAttribute`  

Was class ConfigAttribute; now class ConfigAttribute(t.Generic\[T\]). [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.config.ConfigAttribute.__get__`  

Was def \_\_get\_\_(self, obj: t.Any, owner: t.Any = None) -> t.Any; now def \_\_get\_\_(self, obj: App | None, owner: type\[App\] | None = None) -> T | te.Self. [pypi.org](https://pypi.org/project/Flask/3.0.1/)
- **Signature changed** `flask.config.ConfigAttribute.__init__`  

Was def \_\_init\_\_(self, name: str, get_converter: t.Callable | None = None) -> None; now def \_\_init\_\_(self, name: str, get_converter: t.Callable\[\[t.Any\], T\] | None = None) -> None. [pypi.org](https://pypi.org/project/Flask/3.0.1/)

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

## flask 3.0.0 breaking changes

flask 3.0.0, released September 30, 2023: 168 breaking changes.

- **Removed** `flask.app.Blueprint`  

flask.app.Blueprint was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.Config`  

flask.app.Config was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.ConfigAttribute`  

flask.app.ConfigAttribute was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.create_logger`  

flask.app.create_logger was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.DefaultJSONProvider`  

flask.app.DefaultJSONProvider was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.DispatchingJinjaLoader`  

flask.app.DispatchingJinjaLoader was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.find_package`  

flask.app.find_package was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.JSONProvider`  

flask.app.JSONProvider was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.Scaffold`  

flask.app.Scaffold was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)
- **Removed** `flask.app.setupmethod`  

flask.app.setupmethod was removed in Flask 3.0.0 [pypi.org](https://pypi.org/project/Flask/3.0.0/)

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

## Older versions

2 older versions, each with its first changes. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

### flask 2.0.0 breaking changes

flask 2.0.0, released May 11, 2021: 61 breaking changes.

- **Removed** `flask.app.integer_types`  

flask.app.integer_types was removed in Flask 2.0.0 [pypi.org](https://pypi.org/project/Flask/2.0.0/)
- **Removed** `flask.app.locked_cached_property.__doc__`  

flask.app.locked_cached_property.\_\_doc\_\_ was removed in Flask 2.0.0 [pypi.org](https://pypi.org/project/Flask/2.0.0/)

And 59 more in this version.

### flask 1.0 breaking changes

flask 1.0, released April 26, 2018: 31 breaking changes.

- **Removed** `flask.cli.find_default_import_path`  

flask.cli.find_default_import_path was removed in Flask 1.0 [pypi.org](https://pypi.org/project/Flask/1.0/)
- **Removed** `flask.cli.prepare_exec_for_file`  

flask.cli.prepare_exec_for_file was removed in Flask 1.0 [pypi.org](https://pypi.org/project/Flask/1.0/)

And 29 more in this version.

## 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.
