This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tkinter variables no works with wantobject is false
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-12-25 16:16 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tkinter_variables_wantobjects.patch serhiy.storchaka, 2013-12-25 16:16 review
Messages (2)
msg206926 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-25 16:16
Tkinter variables test fails when wantobjects is false:

======================================================================
ERROR: test_default (__main__.TestVariable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_variables.py", line 29, in test_default
    self.assertEqual("", v.get())
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 239, in get
    return self._tk.globalgetvar(self._name)
_tkinter.TclError: can't read "PY_VAR0": no such variable

======================================================================
ERROR: test_default (__main__.TestStringVar)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_variables.py", line 79, in test_default
    self.assertEqual("", v.get())
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 291, in get
    value = self._tk.globalgetvar(self._name)
_tkinter.TclError: can't read "PY_VAR2": no such variable

======================================================================
ERROR: test_default (__main__.TestIntVar)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_variables.py", line 92, in test_default
    self.assertEqual(0, v.get())
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 313, in get
    return getint(self._tk.globalgetvar(self._name))
_tkinter.TclError: can't read "PY_VAR3": no such variable

======================================================================
ERROR: test_default (__main__.TestDoubleVar)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_variables.py", line 114, in test_default
    self.assertEqual(0.0, v.get())
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 332, in get
    return getdouble(self._tk.globalgetvar(self._name))
_tkinter.TclError: can't read "PY_VAR4": no such variable

======================================================================
ERROR: test_default (__main__.TestBooleanVar)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 352, in get
    return self._tk.getboolean(self._tk.globalgetvar(self._name))
_tkinter.TclError: can't read "PY_VAR5": no such variable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_variables.py", line 141, in test_default
    self.assertEqual(False, v.get())
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 354, in get
    raise ValueError("invalid literal for getboolean()")
ValueError: invalid literal for getboolean()

======================================================================
FAIL: test___del__ (__main__.TestVariable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_variables.py", line 38, in test___del__
    self.assertFalse(self.root.call("info", "exists", "varname"))
AssertionError: '0' is not false

======================================================================
FAIL: test_dont_unset_not_existing (__main__.TestVariable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_variables.py", line 45, in test_dont_unset_not_existing
    self.assertFalse(self.root.call("info", "exists", "varname"))
AssertionError: '0' is not false

----------------------------------------------------------------------

Here is a patch which fixes tkinter and tests.
msg206950 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-12-26 18:09
New changeset b13c15a9ae54 by Serhiy Storchaka in branch '2.7':
Issue #20067: Tkinter variables now work when wantobjects is false.
http://hg.python.org/cpython/rev/b13c15a9ae54

New changeset fbc1a39b68e4 by Serhiy Storchaka in branch '3.3':
Issue #20067: Tkinter variables now work when wantobjects is false.
http://hg.python.org/cpython/rev/fbc1a39b68e4

New changeset 99df5128d978 by Serhiy Storchaka in branch 'default':
Issue #20067: Tkinter variables now work when wantobjects is false.
http://hg.python.org/cpython/rev/99df5128d978
History
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64266
2013-12-26 18:11:05serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-12-26 18:09:01python-devsetnosy: + python-dev
messages: + msg206950
2013-12-25 16:16:22serhiy.storchakacreate