Title: IntVar() - AttributeError: 'NoneType' object has no attribute 'tk'
Type: behavior Stage:
Components: Tkinter Versions: Python 3.1
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Plazma
Priority: normal Keywords:

Created on 2010-02-11 21:20 by Plazma, last changed 2010-02-11 21:57 by brian.curtin. This issue is now closed.

File name Uploaded Description Edit Plazma, 2010-02-11 21:20 IntVar - Test Code - Plazma, 2010-02-11 21:48
Messages (2)
msg99238 - (view) Author: Nick (Plazma) Date: 2010-02-11 21:20
I tried to run the attached code and it seems IntVar() dies in the Tkinter module. After discussion with several other coworkers they seem to agree this may be a bug in Tkinter. If you need more info feel free to let me know and I can help with further testing.

OS: Windows XP 32-bit SP2
Python: Python 3.1.1


Traceback (most recent call last):
  File "H:/code/python/hfprog_sounds/", line 3, in <module>
    num_good = IntVar()
  File "C:\Python31\lib\tkinter\", line 265, in __init__
    Variable.__init__(self, master, value, name)
  File "C:\Python31\lib\tkinter\", line 174, in __init__
    self._tk =
AttributeError: 'NoneType' object has no attribute 'tk'
msg99240 - (view) Author: Nick (Plazma) Date: 2010-02-11 21:48
Ok this was my own mistake and not a bug.. really sorry about this.

Moving the following code ABOVE the IntVar() calls allows it to work:

app = Tk()

See revised attached
Date User Action Args
2010-02-11 21:57:44brian.curtinsettype: compile error -> behavior
resolution: not a bug
2010-02-11 21:48:12Plazmasetstatus: open -> closed
files: +
messages: + msg99240
2010-02-11 21:20:19Plazmacreate