Open LazyTrader opened 3 years ago
Hey @LazyTrader, thanks for reporting. We'll try to fix this problem in our 4.2.2 version, to be released in mid February.
In the meantime, I'm afraid you'll have to open a new console instead of restarting the kernel of the current one to avoid this bug.
Thank you :) Keep up the great work!
This is happening to me in Spyder 5.4.2. Trash can icon in explorer: no change Restart kernel from Consoles menu: no change Refresh icon after either of the actions above: no change
Start a new console: Variable Explorer is cleared in the new console
This happens only when I get a Traceback after a window is open, and then close that window by clicking its "X" icon. I happen to be using tkinter. If the stack trace comes before the window is open or if the program runs cleanly, Variable Explorer can still be cleared normally.
This happens only when I get a Traceback after a window is open
What traceback and window are you referring to? Please be more specific. If you can post that traceback here, then we can analyze it and see how to fix this error.
Here is a small example, crudely cut down from a project I was starting. It seems that any Traceback will do. Here I am calling a nonexistent function, crash_here(), on an instance of Tk. If called before the frames are built there is no problem. If called after, the variables will not clear.
from tkinter import Tk
from tkinter import LabelFrame, Listbox, Variable
#from tkinter import DISABLED, SUNKEN
from tkinter import N, S, W, E
from tkinter.constants import SINGLE, EXTENDED
root = Tk()
root.title("Frame Intro")
#root.iconbitmap("OY.ico")
root.geometry("800x800")
root.grid_rowconfigure(0, weight=1)
root.grid_columnconfigure(2, weight=1)
# Calling this here does NOT trigger the bug.
#root.crash_here()
print("Building frames")
dirVar = Variable()
frame_files = Listbox(root, listvariable=dirVar, selectmode=SINGLE)
frame_files.grid(row=0, column=0, padx=10, pady=10, sticky=N+S) # pad outside the frame
frame_thumbs = LabelFrame(root, text="Thumbs", padx=50, pady=50) # pad inside the frame
frame_thumbs.grid(row=0, column=1, padx=10, pady=10, sticky=N+S) # pad outside the frame
root.crash_here()
root.mainloop()
Ok, thanks for the code example @VeloSteve. I can't reproduce this error on Linux though.
@dalthviz, could you check on Windows?
An additional question for you @VeloSteve: did you set the console Graphics backend to be Tkinter
in our Preferences?
Running the example code on Windows with the latest Spyder standalone installer version (5.4.2), using the default interpreter the Tkinter graphics backend and the default run settings, I got traceback in the Console and a Tkinter window. While the Tkinter window was still open I cleared the variables from the variable explorer and that worked but I had to manually close the window. Restarting the kernel while the window was being shown also worked but the window closed automatically. I tested using the default interpreter and the Tkinter graphics backend.
However, running with the Directly enter debugging when errors appear
caused the variable explorer to not fully empty the variables and I got still two variables (after clearing the variables and restarting the kernel):
Not totally sure but could those be the variables not cleared?
Thanks @dalthviz for the additional testing! I can confirm your findings: if you try to remove all variables while you're debugging, then the variable explorer leaves attr
and self
behind.
@impact27, could you take a look at this one?
I have the same problem. Variables are never cleared after restarting the kernel. I use Spyder 5.4.3. on windows 11.
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
Restarting the kernel does not clear variables. Attempting to delete them after a kernel restart results in "Exception in comms call remove_value:".
What steps reproduce the problem?
What is the expected output? What do you see instead?
The variables should be cleared after a kernel restart
Paste Traceback/Error Below (if applicable)
Versions
Dependencies