fix: replace nest_asyncio for Python 3.14 compatibility#116
Open
lior-airis wants to merge 1 commit intodanielnsilva:masterfrom
Open
fix: replace nest_asyncio for Python 3.14 compatibility#116lior-airis wants to merge 1 commit intodanielnsilva:masterfrom
lior-airis wants to merge 1 commit intodanielnsilva:masterfrom
Conversation
…patibility nest_asyncio is unmaintained and incompatible with Python 3.14: asyncio.current_task() returns None under its patched event loop, causing anyio (used by httpcore/httpx) to crash with "TypeError: cannot create weak reference to 'NoneType' object" on every HTTP request. Replace nest_asyncio.apply() + loop.run_until_complete() with a _run_async() helper that uses asyncio.run() directly when no event loop is running, or dispatches to a worker thread when called from within a running loop (e.g. Jupyter notebooks). Co-Authored-By: Claude Opus 4.6 <[email protected]>
This was referenced Mar 2, 2026
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.
Summary
nest_asynciois unmaintained and incompatible with Python 3.14asyncio.current_task()returnsNoneundernest_asyncio's patched event loop, causinganyio(used byhttpcore/httpx) to crash withTypeError: cannot create weak reference to 'NoneType' objecton every HTTP request93bc2canest_asyncio.apply()+loop.run_until_complete()with a_run_async()helper that usesasyncio.run()directly when no event loop is running, or dispatches to a worker thread when called from within a running loop (preserving Jupyter notebook compatibility)PaginatedResults._get_next_page()which had the same patternnest_asynciofromrequirements.txtandsetup.pyTest plan
🤖 Generated with Claude Code