Change some setting defaults when not using a Twisted reactor. Some settings need different defaults when using and not using a reactor, but as we can't put this logic into default_settings.py we change them here when the reactor is not used.
(self)
| 152 | ) |
| 153 | |
| 154 | def _apply_reactorless_default_settings(self) -> None: |
| 155 | """Change some setting defaults when not using a Twisted reactor. |
| 156 | |
| 157 | Some settings need different defaults when using and not using a |
| 158 | reactor, but as we can't put this logic into default_settings.py we |
| 159 | change them here when the reactor is not used. |
| 160 | """ |
| 161 | self.settings.set("TELNETCONSOLE_ENABLED", False, priority="default") |
| 162 | for scheme in ("http", "https"): |
| 163 | self.settings["DOWNLOAD_HANDLERS_BASE"][scheme] = ( |
| 164 | "scrapy.core.downloader.handlers._httpx.HttpxDownloadHandler" |
| 165 | ) |
| 166 | self.settings["DOWNLOAD_HANDLERS_BASE"]["ftp"] = None |
| 167 | |
| 168 | # Cannot use @deferred_f_from_coro_f because that relies on the reactor |
| 169 | # being installed already, which is done within _apply_settings(), inside |