Handle OSError download fallback for factor loader

This commit is contained in:
2026-04-07 15:57:16 +08:00
parent 0e94688066
commit c46727b1ca
2 changed files with 27 additions and 1 deletions

View File

@@ -99,7 +99,7 @@ def load_external_us_factors(cache_dir: Path | str = "data/factors") -> pd.DataF
try:
raw_bytes = _download_kf_zip_bytes()
except (URLError, TimeoutError, ConnectionError) as exc:
except (URLError, TimeoutError, ConnectionError, OSError) as exc:
if cache_path.exists():
return _warn_and_load_cached_factors(cache_path, f"download failed: {exc}")
raise