Created on 2014-02-23 17:13 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.
Witnessed on 2.7, 3.3, 3.4: $ ./python -m test -uall -R3:3 test_tcl [1/1] test_tcl beginning 6 repetitions 123456 ...... test_tcl leaked [12, 12, 12] references, sum=36 test_tcl leaked [5, 5, 5] memory blocks, sum=15
This actually appeared with 89b738e3d0c9, i.e. it's not a regression but an existing leak that was uncovered by a new test.
Actually, this looks mostly like a cleanup issue in the tests. Following patch seems to solve it:
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -376,6 +376,7 @@ class TclTest(unittest.TestCase):
result = arg
return arg
self.interp.createcommand('testfunc', testfunc)
+ self.addCleanup(self.interp.tk.deletecommand, 'testfunc')
def check(value, expected, eq=self.assertEqual):
r = self.interp.call('testfunc', value)
self.assertIsInstance(result, str)
LGTM. There is a little related but more complex issue1524639.
New changeset 38a06e411698 by Antoine Pitrou in branch '3.3': Issue #20743: Fix a reference leak in test_tcl. http://hg.python.org/cpython/rev/38a06e411698 New changeset 10b1f60a72fa by Antoine Pitrou in branch 'default': Issue #20743: Fix a reference leak in test_tcl. http://hg.python.org/cpython/rev/10b1f60a72fa
New changeset 00393de6919d by Antoine Pitrou in branch '2.7': Issue #20743: Fix a reference leak in test_tcl. http://hg.python.org/cpython/rev/00393de6919d
Ok, fixed now.
stage: commit review -> resolved