fix: guard browser path against unsupported Python (3.14+) - #11
Open
enieuwy wants to merge 1 commit into
Open
Conversation
On Python 3.14 every CloakBrowser/Playwright launch dies with the cryptic 'Sync API inside the asyncio loop', breaking all institutional fetches (issue Rimagination#9). Two guards: - requires-python capped to '>=3.10,<3.14' so new installs fail fast with a clear pip message until Playwright supports 3.14. - prepare_cloakbrowser_runtime() now logs a clear, actionable warning on Python >= 3.14 (browser needs 3.10-3.13; OA/arXiv still work), so an existing 3.14 env explains the failure instead of crashing cryptically. Adds a unit test for the version check. No effect on supported Pythons.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9.
On Python 3.14, every CloakBrowser/Playwright launch fails with
Sync API inside the asyncio loop, breaking all institutional/browser fetches (OA + arXiv HTTP fetches are unaffected). This turns that cryptic crash into a clear, actionable message and prevents new installs from landing on 3.14.Changes
requires-python = ">=3.10,<3.14"— new installs fail fast with a clear pip error until Playwright supports 3.14.prepare_cloakbrowser_runtime()logs a clear one-time warning on Python >= 3.14 (browser workflows need 3.10-3.13; OA/arXiv still work). It only warns — never raises at import — so existing 3.14 environments degrade gracefully with an explanation instead of a baffling traceback.browser_python_warning()helper + unit test.Testing
tests/test_python_guard.py: supported versions (3.10-3.13) -> no warning; 3.14/3.15/4.0 -> clear message naming the version.Based on
main.