Merge branch 'stable'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parents 809d5a8, 5559ef4 · Browse files · 6 files·+19 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+19 added−8 removed
- other:+19 added−8 removed
Provenance
- Commit
5880bef- Tree
7698ace- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
809d5a8- Parent 2
5559ef4
6 files changed+19 added−8 removed
modified:docs/patterns/javascript.rst+5 added-3 removed
134 unmodified lines135 In general, prefer sending request data as form data, as would be used136 when submitting an HTML form. JSON can represent more complex data, but137 unless you need that it's better to stick with the simpler format. When138 sending JSON data, the ``Content-Type: application/json`` header must be139-sent as well, otherwise Flask will return a 400 error.139+sent as well, otherwise Flask will return a 415 Unsupported Media Type140+error.141 142 .. code-block:: javascript143 144 let data = {99 unmodified lines244 -----------------------245 246 Use the :attr:`~flask.Request.json` property of the247 :data:`~flask.request` object to decode the request's body as JSON. If247-the body is not valid JSON, or the ``Content-Type`` header is not set to248-``application/json``, a 400 Bad Request error will be raised.248+the body is not valid JSON, a 400 Bad Request error will be raised. If249+the ``Content-Type`` header is not set to ``application/json``, a 415250+Unsupported Media Type error will be raised.251 252 .. code-block:: python253 254 from flask import request7 unmodified linesmodified:src/flask/sansio/app.py+1 added-1 removed
528 unmodified lines529 .. versionadded:: 0.7530 """531 return DispatchingJinjaLoader(self)532 533- def select_jinja_autoescape(self, filename: str) -> bool:533+ def select_jinja_autoescape(self, filename: str | None) -> bool:534 """Returns ``True`` if autoescaping should be active for the given535 template name. If no template name is given, returns `True`.536 537 .. versionchanged:: 2.2472 unmodified linesmodified:src/flask/app.py+2 added-2 removed
356 unmodified lines357 self.add_url_rule(358 f"{self.static_url_path}/<path:filename>",359 endpoint="static",360 host=static_host,361- view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950361+ view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore362 )363 364 def get_send_file_max_age(self, filename: str | None) -> int | None:365 """Used by :func:`send_file` to determine the ``max_age`` cache1201 unmodified lines1567 response = self.full_dispatch_request(ctx)1568 except Exception as e:1569 error = e1570 response = self.handle_exception(ctx, e)1571- except: # noqa: B0011571+ except:1572 error = sys.exc_info()[1]1573 raise1574 return response(environ, start_response)1575 finally:16 unmodified linesmodified:src/flask/sessions.py+1 added-1 removed
105 unmodified lines106 "key was set. Set the secret_key on the "107 "application to something unique and secret."108 )109 110- __setitem__ = __delitem__ = clear = pop = popitem = update = setdefault = _fail # noqa: B950110+ __setitem__ = __delitem__ = clear = pop = popitem = update = setdefault = _fail111 del _fail112 113 114 class SessionInterface:285 unmodified linesmodified:.pre-commit-config.yaml+7 added-1 removed
123455678910111213141516171819204 unmodified linesrepos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: 45ef068da5f21267bb2a7ec4a623092959f09ce5 # frozen: v0.14.14 hooks: - id: ruff - id: ruff-check - id: ruff-format - repo: https://github.com/astral-sh/uv-pre-commit rev: 8afdb18d56d3bd3edea0c4ddde96965d6894f5f3 # frozen: 0.9.26 hooks: - 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 rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: - id: check-merge-conflict4 unmodified linesmodified:pyproject.toml+3 added
166 unmodified lines167 [tool.ruff.lint.isort]168 force-single-line = true169 order-by-type = false170 171+[tool.codespell]172+ignore-words-list = "te"173+174 [tool.tox]175 env_list = [176 "py3.14", "py3.14t",177 "py3.13", "py3.12", "py3.11", "py3.10",104 unmodified lines