Summary
On Python 3.14, every code path that launches the browser (institutional access via fetch/batch, federated-login, login) fails immediately with:
[ERROR] instsci.auth: Failed to start CloakBrowser: It looks like you are using
Playwright Sync API inside the asyncio loop. Please use the Async API instead.
This makes all institutional/CloakBrowser fetching non-functional on 3.14, regardless of credentials or configuration. OA/arXiv HTTP fetches are unaffected.
Repro
python3.14 -m venv .venv && .venv/bin/pip install -e .
- Configure any institutional path, then
instsci fetch <closed-access DOI> (or instsci federated-login -p tandfonline).
- Resolution reaches "Opening browser for login…" and then raises the error above.
Root cause
Python 3.14 changed event-loop/asyncio internals such that Playwright's Sync API now detects a running loop where it previously didn't, and refuses to run. CloakBrowser/instsci drive Playwright via the sync API from within an async context, which 3.14 rejects. Playwright does not yet officially support 3.14.
Confirmation
Recreating the venv on Python 3.12.13 resolves it — session-doctor and the browser launch path run with no sync/async error. So this is environmental (Python 3.14), not a logic bug.
Suggested mitigation
Pick one (or more):
- Version guard: have
setup/doctor warn (or refuse the browser path) when running on Python ≥ 3.14, with a clear "use 3.12/3.13" message — fits the existing precondition-envelope style.
- Pin supported range in
pyproject.toml (requires-python = ">=3.10,<3.14") until Playwright supports 3.14.
- Longer term: migrate the browser driver to Playwright's async API so it's robust to loop changes.
Happy to send a PR for the doctor/requires-python guard if that direction is acceptable.
Summary
On Python 3.14, every code path that launches the browser (institutional access via
fetch/batch,federated-login,login) fails immediately with:This makes all institutional/CloakBrowser fetching non-functional on 3.14, regardless of credentials or configuration. OA/arXiv HTTP fetches are unaffected.
Repro
python3.14 -m venv .venv && .venv/bin/pip install -e .instsci fetch <closed-access DOI>(orinstsci federated-login -p tandfonline).Root cause
Python 3.14 changed event-loop/
asynciointernals such that Playwright's Sync API now detects a running loop where it previously didn't, and refuses to run. CloakBrowser/instsci drive Playwright via the sync API from within an async context, which 3.14 rejects. Playwright does not yet officially support 3.14.Confirmation
Recreating the venv on Python 3.12.13 resolves it —
session-doctorand the browser launch path run with no sync/async error. So this is environmental (Python 3.14), not a logic bug.Suggested mitigation
Pick one (or more):
setup/doctorwarn (or refuse the browser path) when running on Python ≥ 3.14, with a clear "use 3.12/3.13" message — fits the existing precondition-envelope style.pyproject.toml(requires-python = ">=3.10,<3.14") until Playwright supports 3.14.Happy to send a PR for the
doctor/requires-pythonguard if that direction is acceptable.