flask breaking changes
Updated December 4, 2026
On this page
Latest version 3.1.3, released February 19, 2026. Source repository
Its 3.1.0 release drops Python 3.8. Python end of life dates.
- From 2.0.0 to 3.1.3: 223 breaking changes in 6 versions.
- From 1.0 to 3.1.3: 284 breaking changes in 7 versions.
flask 3.1.3 breaking changes
- Removed
flask.sessions.SecureCookieSession.__getitem__
SecureCookieSession.__getitem__ was removed in Flask 3.1.3 pypi.org - Removed
flask.sessions.SecureCookieSession.get
SecureCookieSession.get was removed in Flask 3.1.3 pypi.org - Removed
flask.sessions.SecureCookieSession.setdefault
SecureCookieSession.setdefault was removed in Flask 3.1.3 pypi.org - Signature changed
flask.app.RequestContext.session
Was session: SessionMixin | None; now session: SessionMixin. pypi.org - 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
flask 3.1.2 breaking changes
- 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
flask 3.1.1 breaking changes
- 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
flask 3.1.0 breaking changes
- Removed
Flask 3.1.0 no longer supports Python 3.8, so upgrade the interpreter before installing this release. github.com - 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 - 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 - 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 - 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 - 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 - 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 - 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 - Signature changed
flask.ctx.SessionMixin
Was class SessionMixin(MutableMapping); now class SessionMixin(MutableMapping[str, t.Any]). pypi.org - 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
And 8 more in this version. Sign up to see every change
flask 3.0.1 breaking changes
- Removed
flask.json.provider.Response
flask.json.provider.Response was removed in Flask 3.0.1 pypi.org - 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 - 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 - 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 - 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 - 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 - 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 - Signature changed
flask.config.ConfigAttribute
Was class ConfigAttribute; now class ConfigAttribute(t.Generic[T]). pypi.org - 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 - 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
And 20 more in this version. Sign up to see every change
flask 3.0.0 breaking changes
- Removed
flask.app.Blueprint
flask.app.Blueprint was removed in Flask 3.0.0 pypi.org - Removed
flask.app.Config
flask.app.Config was removed in Flask 3.0.0 pypi.org - Removed
flask.app.ConfigAttribute
flask.app.ConfigAttribute was removed in Flask 3.0.0 pypi.org - Removed
flask.app.create_logger
flask.app.create_logger was removed in Flask 3.0.0 pypi.org - Removed
flask.app.DefaultJSONProvider
flask.app.DefaultJSONProvider was removed in Flask 3.0.0 pypi.org - Removed
flask.app.DispatchingJinjaLoader
flask.app.DispatchingJinjaLoader was removed in Flask 3.0.0 pypi.org - Removed
flask.app.find_package
flask.app.find_package was removed in Flask 3.0.0 pypi.org - Removed
flask.app.JSONProvider
flask.app.JSONProvider was removed in Flask 3.0.0 pypi.org - Removed
flask.app.Scaffold
flask.app.Scaffold was removed in Flask 3.0.0 pypi.org - Removed
flask.app.setupmethod
flask.app.setupmethod was removed in Flask 3.0.0 pypi.org
And 158 more in this version. Sign up to see every change
Older versions
2 older versions, each with its first changes. Sign up to see every change
Show 2 older versions
flask 2.0.0 breaking changes
- Removed
flask.app.integer_types
flask.app.integer_types was removed in Flask 2.0.0 pypi.org - Removed
flask.app.locked_cached_property.__doc__
flask.app.locked_cached_property.__doc__ was removed in Flask 2.0.0 pypi.org
And 59 more in this version.
flask 1.0 breaking changes
- Removed
flask.cli.find_default_import_path
flask.cli.find_default_import_path was removed in Flask 1.0 pypi.org - Removed
flask.cli.prepare_exec_for_file
flask.cli.prepare_exec_for_file was removed in Flask 1.0 pypi.org
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, 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.