From cb28d7486759a2ee69dc2f9052ffad7844ff3007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=81=E4=BA=8C=E6=9C=88=E4=BD=9C=E6=9B=B2=E5=AE=B6?= Date: Thu, 18 Jun 2026 17:48:54 +0800 Subject: [PATCH] fix: deprecate ScrapyCommand.help() which is never called The help() method claimed it would be displayed by the 'help' command, but that command doesn't exist and the method is never invoked by the framework. Added deprecation warning so subclasses use long_desc() instead. --- scrapy/commands/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scrapy/commands/__init__.py b/scrapy/commands/__init__.py index 19b6f6681..f55922c90 100644 --- a/scrapy/commands/__init__.py +++ b/scrapy/commands/__init__.py @@ -71,7 +71,19 @@ class ScrapyCommand(ABC): """An extensive help for the command. It will be shown when using the "help" command. It can contain newlines since no post-formatting will be applied to its contents. + + .. deprecated:: + This method is never called by the framework. Use ``long_desc()`` + instead. Will be removed in Scrapy 2.15. """ + import warnings + warnings.warn( + "ScrapyCommand.help() is deprecated and never called by the framework. " +" + "Use long_desc() instead.", + DeprecationWarning, + stacklevel=2, + ) return self.long_desc() def add_options(self, parser: argparse.ArgumentParser) -> None: