From 5f4e08f361dfcefe808fa2b1fe501cba086584f8 Mon Sep 17 00:00:00 2001 From: Adrian Chaves Date: Mon, 10 Aug 2026 19:33:26 +0200 Subject: [PATCH] WIP --- docs/news.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/news.rst b/docs/news.rst index 3ae9ae6e1..8bea2dbb2 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -111,11 +111,10 @@ Backward-incompatible changes - ``scrapy.utils.log.logformatter_adapter()`` no longer passes the whole :class:`dict` returned by a :ref:`log formatter ` - method as logging arguments when that ``dict`` has no ``args`` key or its - ``args`` are empty. Such messages are now logged verbatim, so a literal - ``%`` in them no longer breaks logging, and placeholders that referenced - other keys of the returned ``dict``, such as ``%(msg)s``, are no longer - interpolated. + method as logging arguments when that ``dict`` has no ``args`` key, or its + ``args`` are empty, and its ``msg`` has no ``%(name)s`` placeholders. Such + messages are now logged verbatim, so a literal ``%`` in them no longer + breaks logging. An ``args`` :class:`tuple` is now expanded into one logging argument per item, so that ``%``-style placeholders work with it as they do with a @@ -204,6 +203,13 @@ Deprecations future Scrapy version. (:issue:`7738`) +- Returning, from a :ref:`log formatter ` method, a + ``msg`` with ``%(name)s`` placeholders and no ``args`` is deprecated. Those + placeholders are still interpolated with the returned :class:`dict`, but in + a future Scrapy version the message will be logged verbatim. Return those + values under ``args`` instead. + (:issue:`5570`, :issue:`7971`) + New features ~~~~~~~~~~~~