Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with typing.AscyncGenerator for python 3.6.0 #118

Closed
esvhd opened this issue Nov 2, 2020 · 8 comments · Fixed by #120
Closed

Issue with typing.AscyncGenerator for python 3.6.0 #118

esvhd opened this issue Nov 2, 2020 · 8 comments · Fixed by #120

Comments

@esvhd
Copy link

esvhd commented Nov 2, 2020

Hi there,

I upgraded to nbconvert 6.0.7 from from 5.6.1 recently, so as part of that I installed nbclient 0.5.1.

python 3.6.0
typing 3.7.4.3
notebook 6.1.4

I'm running python 3.6.0 on this machine. After the upgraded I started getting these errors when I tried to start a notebook (500, internal error page):

#....
File "h:\anaconda3\lib\site-packages\nbclient\client.py", line447, in NotebookClient
  async def async_setup_kernel(self, **kwargs) -> t.AsyncGenerator:
AttributeError: module 'typing' has no attribute 'AsyncGenerator'

If I revert back to nbconvert 5.6.1 life is back to normal again, notebooks can be opened.

On another machine with python 3.7, I do not see this issue. This might be specifically related to python 3.6.0.

Unfortunately I couldn't upgrade the machine to 3.7 easily... Any idea how / why this was happening to 3.6.0?

Thanks.

@davidbrochart
Copy link
Member

Hi @esvhd, thanks for opening an issue. I can reproduce the bug, but unfortunately fixing it in nbclient won't be enough since prompt-toolkit also has the issue, and they require python>=3.6.1 for that reason. Out of curiosity, what version of prompt-toolkit do you have?

@esvhd
Copy link
Author

esvhd commented Nov 2, 2020

Hi @davidbrochart , thanks for taking the time to look at this. I'm using prompt-toolkit 2.0.4 in this environment.

@davidbrochart
Copy link
Member

I see, I think they didn't have type checking yet in this version, so I guess that a fix in nbclient would work for you. Unfortunately I couldn't find a nice way to ignore the AsyncGenerator return type of async_setup_kernel depending on the python version.
#119 just removes the type. On the other hand, I'm not sure having this return type is of great value. So if nobody has an objection, I will go ahead and merge it.

@esvhd
Copy link
Author

esvhd commented Nov 2, 2020 via email

@davidbrochart
Copy link
Member

cc @MSeal @SylvainCorlay
We can either merge #119 which removes type checking for the return value of async_setup_kernel, or require python>=3.6.1 instead of currently python>=3.6.
Thoughts?

@rgbkrk
Copy link
Member

rgbkrk commented Nov 4, 2020

I'd prefer we require python >= 3.6.1

@SylvainCorlay
Copy link
Member

I'd prefer we require python >= 3.6.1

Same. 3.6.0 will also have outstanding security issues...

@davidbrochart
Copy link
Member

Sorry @esvhd, we won't support python 3.6.0 anymore.

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 a pull request may close this issue.

4 participants