Merge branch 'stable'

This commit is contained in:
David Lord 2026-01-24 19:05:26 -08:00
commit 5880befcd2
No known key found for this signature in database
GPG key ID: 43368A7AA8CC5926
6 changed files with 19 additions and 8 deletions

View file

@ -2,12 +2,18 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: 45ef068da5f21267bb2a7ec4a623092959f09ce5 # frozen: v0.14.14 rev: 45ef068da5f21267bb2a7ec4a623092959f09ce5 # frozen: v0.14.14
hooks: hooks:
- id: ruff - id: ruff-check
- id: ruff-format - id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit - repo: https://github.com/astral-sh/uv-pre-commit
rev: 8afdb18d56d3bd3edea0c4ddde96965d6894f5f3 # frozen: 0.9.26 rev: 8afdb18d56d3bd3edea0c4ddde96965d6894f5f3 # frozen: 0.9.26
hooks: hooks:
- id: uv-lock - id: uv-lock
- repo: https://github.com/codespell-project/codespell
rev: 63c8f8312b7559622c0d82815639671ae42132ac # frozen v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks: hooks:

View file

@ -136,7 +136,8 @@ In general, prefer sending request data as form data, as would be used
when submitting an HTML form. JSON can represent more complex data, but when submitting an HTML form. JSON can represent more complex data, but
unless you need that it's better to stick with the simpler format. When unless you need that it's better to stick with the simpler format. When
sending JSON data, the ``Content-Type: application/json`` header must be sending JSON data, the ``Content-Type: application/json`` header must be
sent as well, otherwise Flask will return a 400 error. sent as well, otherwise Flask will return a 415 Unsupported Media Type
error.
.. code-block:: javascript .. code-block:: javascript
@ -244,8 +245,9 @@ Receiving JSON in Views
Use the :attr:`~flask.Request.json` property of the Use the :attr:`~flask.Request.json` property of the
:data:`~flask.request` object to decode the request's body as JSON. If :data:`~flask.request` object to decode the request's body as JSON. If
the body is not valid JSON, or the ``Content-Type`` header is not set to the body is not valid JSON, a 400 Bad Request error will be raised. If
``application/json``, a 400 Bad Request error will be raised. the ``Content-Type`` header is not set to ``application/json``, a 415
Unsupported Media Type error will be raised.
.. code-block:: python .. code-block:: python

View file

@ -168,6 +168,9 @@ ignore = [
force-single-line = true force-single-line = true
order-by-type = false order-by-type = false
[tool.codespell]
ignore-words-list = "te"
[tool.tox] [tool.tox]
env_list = [ env_list = [
"py3.14", "py3.14t", "py3.14", "py3.14t",

View file

@ -358,7 +358,7 @@ class Flask(App):
f"{self.static_url_path}/<path:filename>", f"{self.static_url_path}/<path:filename>",
endpoint="static", endpoint="static",
host=static_host, host=static_host,
view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950 view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore
) )
def get_send_file_max_age(self, filename: str | None) -> int | None: def get_send_file_max_age(self, filename: str | None) -> int | None:
@ -1568,7 +1568,7 @@ class Flask(App):
except Exception as e: except Exception as e:
error = e error = e
response = self.handle_exception(ctx, e) response = self.handle_exception(ctx, e)
except: # noqa: B001 except:
error = sys.exc_info()[1] error = sys.exc_info()[1]
raise raise
return response(environ, start_response) return response(environ, start_response)

View file

@ -530,7 +530,7 @@ class App(Scaffold):
""" """
return DispatchingJinjaLoader(self) return DispatchingJinjaLoader(self)
def select_jinja_autoescape(self, filename: str) -> bool: def select_jinja_autoescape(self, filename: str | None) -> bool:
"""Returns ``True`` if autoescaping should be active for the given """Returns ``True`` if autoescaping should be active for the given
template name. If no template name is given, returns `True`. template name. If no template name is given, returns `True`.

View file

@ -107,7 +107,7 @@ class NullSession(SecureCookieSession):
"application to something unique and secret." "application to something unique and secret."
) )
__setitem__ = __delitem__ = clear = pop = popitem = update = setdefault = _fail # noqa: B950 __setitem__ = __delitem__ = clear = pop = popitem = update = setdefault = _fail
del _fail del _fail