Skip to content

Fix unawaited asynch call for python>3.13 (use of nest_asyncio2) - #53

Open
JeanLucPons wants to merge 3 commits into
mainfrom
unawaited-asynch-call
Open

JeanLucPons wants to merge 3 commits into
mainfrom
unawaited-asynch-call

Conversation

@JeanLucPons

Copy link
Copy Markdown
Member

This PR fix the following issue in jupyter for python >3.13

image

@TeresiaOlsson

Copy link
Copy Markdown
Member

I'm not sure this will fix the problem. I have it for Python 3.11.

image

@TeresiaOlsson

TeresiaOlsson commented Sep 21, 2026

Copy link
Copy Markdown
Member

@gubaidulinvadim suggested that maybe it can have to do with the jupyter version? This is what I have:

image image

@JeanLucPons

Copy link
Copy Markdown
Member Author

OK I checked with 3.12 and it was fine. The code i did shoudl only affects >3.13.
Apparently, The handling of the jupyter asynch loop using nested_asyncio is well docmented:

From Claude:
This matches what the maintainers themselves say: Python 3.14+ breaks the nest_asyncio workaround... Python 3.14 changed the asyncio implementation in ways that break nest_asyncio. The library can no longer safely monkey-patch asyncio..

@JeanLucPons

Copy link
Copy Markdown
Member Author

Here are my version:

For py312 env:

jupyter-cache                            1.0.1
jupyter_client                           8.7.0
jupyter_core                             5.9.1

For py314

jupyter_client            8.10.0
jupyter_core              5.9.1

@JeanLucPons

Copy link
Copy Markdown
Member Author

Sorry the patch was incomplete, it can explains what you get.

@gubaidulinvadim

Copy link
Copy Markdown
Member

@TeresiaOlsson the issue you have is unrelated to the one @JeanLucPons solved. But I don't know the origin of it. I was also getting some async-related issues because Python 3.14 changed things.

@TeresiaOlsson

Copy link
Copy Markdown
Member

@TeresiaOlsson the issue you have is unrelated to the one @JeanLucPons solved. But I don't know the origin of it. I was also getting some async-related issues because Python 3.14 changed things.

Why? I thought the error message Fernando and I see is exactly what @JeanLucPons is trying to solve in this PR? I don't understand why it is related to Python 3.14? For me I have always had it with 3.11 so I don't think it's connected to the Python version. For me it started to appear when the catalog was added.

@JeanLucPons

Copy link
Copy Markdown
Member Author

The error at line 46 in signal .py can appear only from recent version of pyaml_cs_oa (this is linked to a PR from last week) and the bug is well reproductible with python 3.14. The management of the jupyter asynch loop is clearly broken with new python 3.14 asyncio and explains the problem of this PR. I redid few check with the current patch and for me it is fine.
@TeresiaOlsson may be you can try to use nest_asyncio2 for python 3.11. It should work as well.

@TeresiaOlsson

Copy link
Copy Markdown
Member

I will try it with different python versions and see if it also fixes it for me. But can't try until Thursday since I'm away on a workshop in AI supported research software engineering for a couple of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants