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

Error when send_message is called without buffers #2

Open
ilyabo opened this issue Jun 24, 2021 · 2 comments
Open

Error when send_message is called without buffers #2

ilyabo opened this issue Jun 24, 2021 · 2 comments

Comments

@ilyabo
Copy link

ilyabo commented Jun 24, 2021

Hi @davidbrochart!

It turns out that akernel actually solves the issue with the widget we are building. We can use await to call async methods on our widget and the akernel isn't blocked unlike the default one:

image

Do you think there is a chance of these changes being accepted into the default ipykernel?

Our widget calls self.send(msg) without passing buffers and we are hitting this error:
image

It works just fine if we use self.send(msg, buffers=[]) instead, but I think akernel should also handle buffers=None.

Actually, send_message in akernel has a mutable default list argument for buffers which is problematic. It should probably just have a check if buffers to is not None instead

@kylebarron
Copy link
Contributor

kylebarron added a commit to kylebarron/akernel that referenced this issue Jun 24, 2021
@davidbrochart
Copy link
Owner

Hi @ilyabo!

Do you think there is a chance of these changes being accepted into the default ipykernel?

I don't know ipykernel enough to know if it would be possible, and how hard, but akernel is definitely a project where we can experiment with this kind of new behaviors. If it solves real problems, or offer useful new features, sure we can think of contributing to the official Python kernel. Actually I'm happy that you tried it out, because I knew it could solve issues such as the one you are mentioning.

Thanks a lot @kylebarron for opening a PR, I need to polish akernel as up to now I was just trying to have something working, and was not expecting someone to use it, but very glad it happened! I'll be off for the next 5 days so don't expect any answer until then.

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

No branches or pull requests

3 participants