-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Problems when running code with locals in the debugger #13862
Comments
Hey @OverLordGoldDragon, thanks for reporting. There shouldn't be any need to run Therefore, I think we should disable that command and show a message mentioning that instead. @impact27, what do you think? |
@ccordoba12 Here's the problem without |
That is strange. It looks like something is resetting the local namespace. I think an old version of IPython was doing that. Could you try to update all your dependencies? |
I can't reproduce this error on Linux.
@impact27, should we increase our minimal required IPython version for 4.2? |
@impact27 |
My guess is that some code call |
Maybe it is an issue with ipykernel. Could you try to update it? |
@impact27 That solved the |
@ccordoba12 We should update the minimum version of ipykernel |
Ok, to what version? |
@ccordoba12 I updated to |
I just learned |
I can't |
There will be an option for that |
Well yes that is what the history is for. It just skips single letters |
But does history work in |
Uh, the |
@OverLordGoldDragon, I was surprised when you mentioned that this problem was fixed. I really think it's a duplicate of issue #13909 (even if that issue's title seems unrelated) because we were not using the right namespace when evaluating things on the debugger. So I think we should keep this one open until 4.2 is released and you can test it with it. |
I forgot to mention that the fix to that issue consisted on using the same namespace as |
I don't think it would, we should just disable interact in my opinion. (And fix the locals bug) For reference: ipython/ipython#12445 |
I don't think so, issue #13909 is related to a python bug with list comprehensions, and there is no list comprehension here. |
Could you recreate this: Python 3.8.6 (default, Oct 8 2020, 14:06:32)
Type "copyright", "credits" or "license" for more information.
IPython 7.18.1 -- An enhanced Interactive Python.
In [1]: %debug print
NOTE: Enter 'c' at the ipdb> prompt to continue execution.
> <string>(1)<module>()
ipdb> k = get_ipython().kernel
ipdb> loc = k._pdb_frame.f_locals
ipdb> test
*** NameError: name 'test' is not defined
ipdb> loc["test"] = 1
ipdb> test
1
ipdb> k._pdb_obj.curframe_locals["test"]
1
ipdb> loc = k._pdb_frame.f_locals
ipdb> test
1
ipdb> I don't understand why calling
|
It works exactly the same for me in the latest 4.x |
So the problem with |
So you are correct that this relates to Issue #13909:
|
There's a fix for the Python bug you referenced above in this PR python/cpython#11041. It seems simple enough to add it to our debugger, at least until pep 558 is implemented. |
Another thing interact handles, for the record. (Regular for-loop is fine, but comprehension seems broken) |
demo.mp4. Only way out I found is a kernel restart. Latest Spyder via
conda install
.The text was updated successfully, but these errors were encountered: