Scrapy, a fast high-level web crawling & scraping framework for Python.
Small improvements,
Andrey Rakhmatullinac201d310b81
diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rstindex 3197daf65..1ca7eda7b 100644--- a/docs/topics/spiders.rst+++ b/docs/topics/spiders.rst@@ -142,7 +142,8 @@ scrapy.Spidermethod, which is handy if you want to modify them based onarguments. As a consequence, these settings aren't the final valuesas they can be modified later by e.g. :ref:`add-ons- <topics-addons>`. The settings become final when the spider starts.+ <topics-addons>`. The final settings are available in the+ :meth:`start_requests` method and later.:param crawler: crawler to which the spider will be bound:type crawler: :class:`~scrapy.crawler.Crawler` instancediff --git a/scrapy/addons.py b/scrapy/addons.pyindex 389a3cdde..9060d4f3f 100644--- a/scrapy/addons.py+++ b/scrapy/addons.py@@ -19,7 +19,7 @@ class AddonManager:self.crawler: "Crawler" = crawlerself.addons: List[Any] = []- def apply_settings(self, settings: Settings) -> None:+ def load_settings(self, settings: Settings) -> None:"""Load add-ons and configurations from a settings object and apply them.This will load the add-on for every add-on path in thediff --git a/scrapy/crawler.py b/scrapy/crawler.pyindex ee4d6fd59..22fd65be7 100644--- a/scrapy/crawler.py+++ b/scrapy/crawler.py@@ -79,7 +79,6 @@ class Crawler:self._init_reactor: bool = init_reactorself.crawling: bool = False- self._settings_loaded: bool = Falseself._started: bool = Falseself.extensions: Optional[ExtensionManager] = None@@ -95,11 +94,10 @@ class Crawler:install_scrapy_root_handler(self.settings)def _apply_settings(self) -> None:- if self._settings_loaded:+ if self.settings.frozen:return- self._settings_loaded = True- self.addons.apply_settings(self.settings)+ self.addons.load_settings(self.settings)self.stats = load_object(self.settings["STATS_CLASS"])(self)handler = LogCounterHandler(self, level=self.settings.get("LOG_LEVEL"))