-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
v6 error with breakpoint in function #697
Comments
I can't test right now, but can you try the following patch to narrow down the problem? diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py
index f3ea2a9..9e9c94c 100644
--- a/ipykernel/debugger.py
+++ b/ipykernel/debugger.py
@@ -456,12 +456,15 @@ class Debugger:
handler = self.static_debug_handlers.get(message['command'], None)
if handler is not None:
reply = await handler(message)
+ assert isinstance(reply, dict), f"{handler=} {message=}"
elif self.is_started:
handler = self.started_debug_handlers.get(message['command'], None)
if handler is not None:
reply = await handler(message)
+ assert isinstance(reply, dict), f"{handler=} {message=}"
else:
reply = await self._forward_message(message)
+ assert isinstance(reply, dict), f"{message=}"
if message['command'] == 'disconnect':
self.stop() |
This seems very similar to #647. |
It seem indeed, I'll send a PRs the add some asserts, and improve some warnings and logging to narrow down where the issue comes from. |
The assertion are not raised. When stop on the breakpoint, the function is indeed listed. It looks like that the error comes from the following line as the value may not be jsonable: ipykernel/ipykernel/debugger.py Line 422 in 13d9220
Indeed it seems that the pointer variable to functions (or class in the mentioned issue) are not returning a valid displayable description.
|
Changing that 422 line to - 'value': v,
+ 'value': str(v), results in no more error. But I guess the real patch should be more advanced than that. |
Ah good catch. @JohanMabille I believe you wrote most of these and might be the most qualified to fix it. |
I will work on this tonight. |
The tested cell is:
with the breakpoint set at c = a + b.
Demo of the error - it is only happening when listing the variables without debugging (aka kernel state):
The error seen is:
Xref: jupyterlab/jupyterlab#10502
The text was updated successfully, but these errors were encountered: