fix(sources): drop no-op try/except + url-encode S2 ids (audit R-4, R-5)

- R-4: arxiv.fetch_source had a try/except httpx.RequestError that only re-raised
  — removed (no behaviour change, less noise).
- R-5: semanticscholar URLs now quote(paper_id, safe=':') so a legacy-arXiv '/'
  (arXiv:math/0603097) doesn't corrupt the path and silently return no references.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-06-15 21:39:48 +02:00
parent b4fbd7930e
commit c7fae5c877
2 changed files with 6 additions and 6 deletions

View File

@@ -38,10 +38,7 @@ def fetch_source(arxiv_id: str) -> str | None:
file is present (signals Nougat fallback).
"""
url = f"{_BASE}/src/{arxiv_id}"
try:
response = httpx.get(url, timeout=60, follow_redirects=True)
except httpx.RequestError:
raise
response = httpx.get(url, timeout=60, follow_redirects=True)
if response.status_code == 404:
logger.debug("arXiv 404 for source id=%s", arxiv_id)
return None