Page 1 of 1

Thonny complains object has no attribute '_w'

Posted: Fri Nov 30, 2018 3:11 pm
by RogerW
I have a simple tkinter program to try out Thonny 3 debug.

Code: Select all

import tkinter as tk

class Mainframe(tk.Frame):
    def __init__(self,master,*args,**kwargs):
        tk.Frame.__init__(self,master,*args,**kwargs)
     
class App(tk.Tk):
    def __init__(self):
        tk.Tk.__init__(self)
        self.title('Simple test')
        self.geometry('300x100')
      
        Mainframe(self).pack()
        
        self.mainloop()
                    
App()
When I try to debug by pressing the over button I eventually get the message
AttributeError: 'Mainframe' object has no attribute '_w'

A google search only came up with the suggestion that the base class is not being called - but it is. Is this a bug or am I missing something?

Re: Thonny complains object has no attribute '_w'

Posted: Fri Nov 30, 2018 4:20 pm
by MrYsLab
I believe you found a bug in Thonny. I just ran your code in Debug mode using the mu-editor, stepping through each line and it works without error.
I also ran it on an Ubuntu box using the Pycharm debugger, and it works fine as well. I tried using Thonny and I am seeing the same error as you.