v0.6.2a3
Pre-release
Pre-release
Fixed
-
All Scrapy versions — unified async dispatch in
BaseEngine.fetch
Scrapy routes async downloader middlewares through one of two runners depending on
the version, and each runner requires a different awaitable type:Scrapy path Runner Needs ensure_awaitable(newer Scrapy, local)asyncio Task asyncio.Future(run_in_executor)deferred_from_coro(Zytescrapy:2.11–2.12)Twisted _inlineCallbacksTwisted Deferred(deferToThread)BaseEngine.fetchnow detects the active runner viaasyncio.get_running_loop():
if a running loop is found (asyncio Task context) it usesloop.run_in_executor;
ifRuntimeErroris raised (no asyncio Task, Twisted_inlineCallbackscontext)
it falls back todeferToThread. This replaces the single-strategy implementations
froma2that each fixed one path but broke the other.