scrapy / scrapy

Scrapy, a fast high-level web crawling & scraping framework for Python.
https://scrapy.org
BSD 3-Clause "New" or "Revised" License
51.29k stars 10.37k forks source link

Make certain args of `ScrapyAgent` and `TunnelingAgent` required #6343

Closed wRAR closed 3 weeks ago

wRAR commented 3 weeks ago

scrapy.core.downloader.handlers.http11.ScrapyAgent and scrapy.core.downloader.handlers.http11.TunnelingAgent take some args (contextFactory in both and crawler in ScrapyAgent) that are currently declared optional but in fact need to be passed as the code assumes they aren't None. So ideally they should be declared as required (but that requires reordering args and/or making all args of those constructors keyword-only so there is no clear and simple fix).

kumar-sanchay commented 3 weeks ago

Creating PR for this