v0.6.8a2
Pre-releaseAdded
-
StealthDependencyError— typed exception for compiled-dependency failures
New exception class inexceptions.pythat inherits from bothStealthExceptionand
ImportError, fitting naturally into both the package exception hierarchy and standard
except ImportErrorhandlers.
Raised whenever a compiled optional dependency (wreq,curl_cffi) fails to load —
typically because a required native DLL or shared library could not be found.The exception provides a platform-aware, actionable message at raise time:
- Windows — instructs the user to install both x64 and x86 Visual C++ Redistributables
(2015–2022) with direct download links. - Linux — suggests the appropriate
apt-get/yumpackages for missing system
libraries (libssl,libcurl).
StealthDependencyErroris exported from the top-level package and added to__all__,
making it catchable in user code alongside the other stealth exceptions. - Windows — instructs the user to install both x64 and x86 Visual C++ Redistributables
Fixed
-
engines/basic.py—ImportError: DLL load failed while importing wreqon fresh Windows
The barefrom wreq.blocking import Clientandfrom wreq.proxy import Proxymodule-level
imports crashed immediately on machines without the Visual C++ Redistributable installed,
surfacing as an opaqueDLL load failedtraceback deep inside Scrapy's middleware loader.
Both imports are now wrapped intry/except ImportErrorand delegate to
StealthDependencyError.check("wreq", exc)for a clear, actionable error message. -
engines/turbo.py— same DLL failure forcurl_cffion fresh Windows
from curl_cffi import CurlHttpVersionandfrom curl_cffi.requests import Sessionsuffer
the same failure path aswreqwhen the VCRT is absent.
Both imports are now guarded withStealthDependencyError.check("curl_cffi", exc). -
utils/profiles.py—wreq.emulationcrash at import time propagated silently
from wreq.emulation import Emulation, Profilewas a module-level import, meaning the
entireprofilesmodule — and by extension every engine that imports it — failed to load
on VCRT-missing machines, producing the same deepDLL load failedtraceback.
The import is now guarded with a_WREQ_AVAILABLEflag;EmulationandProfilefall
back toNoneso the module loads cleanly. The private_require_wreq()helper raises
StealthDependencyErrorat the point of actual use (inside_resolve_basic), not at
import time, keeping theturboandbrowserdrivers unaffected on machines where
wreqis broken butcurl_cffiloads fine.