Issue 10228: Refleak run of test_dbm fails when several dbm modules are available (original) (raw)

Issue10228

Created on 2010-10-29 10:11 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg119877 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-29 10:11
This is only when several dbm modules are compiled in (e.g. "gnu" and "dumb"): $ ./python -m test.regrtest -R 3:2 test_dbm [1/1] test_dbm beginning 5 repetitions 12345 test test_dbm failed -- Traceback (most recent call last): File "/home/antoine/py3k/deallocwarn/Lib/test/test_dbm.py", line 129, in test_whichdb self.assertEqual(name, dbm.whichdb(_fname)) AssertionError: 'dbm.gnu' != 'dbm.dumb' - dbm.gnu + dbm.dumb
msg120583 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-06 05:38
A quick look makes me think the bug is in the test, not the code.
msg129064 - (view) Author: ysj.ray (ysj.ray) Date: 2011-02-22 12:41
It looks like because before the second time running of WhichDBTestCase.test_whichdb(), previous dumb files are not cleaned clearly, so the gdbm's open() doesn't create a new gdbm database but open an existing dumb database. In fact during the working of #9523, I found this problem and fix it in the patch of #9523. Here I extract the fixing, it is simple: cat patches/issue10228.diff Index: Lib/test/test_dbm.py =================================================================== --- Lib/test/test_dbm.py (revision 88499) +++ Lib/test/test_dbm.py (working copy) @@ -123,7 +123,7 @@ name = module.__name__ if name == 'dbm.dumb': continue # whichdb can't support dbm.dumb - test.support.unlink(_fname) + delete_files() f = module.open(_fname, 'c') f.close() self.assertEqual(name, dbm.whichdb(_fname))
msg129497 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-02-26 03:44
Fixed in revision 88631
msg129499 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-26 06:31
Can you backport to 3.2?
msg129505 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-02-26 07:11
Done in r88634.
History
Date User Action Args
2022-04-11 14:57:08 admin set github: 54437
2011-02-26 07:11:50 orsenthil set nosy:orsenthil, pitrou, giampaolo.rodola, eric.araujo, ysj.raymessages: +
2011-02-26 06:31:53 pitrou set nosy:orsenthil, pitrou, giampaolo.rodola, eric.araujo, ysj.raymessages: +
2011-02-26 03:44:54 orsenthil set status: open -> closednosy: + orsenthilmessages: + resolution: fixedstage: needs patch -> resolved
2011-02-22 12:41:53 ysj.ray set nosy: + ysj.raymessages: +
2010-11-08 11:52:56 michael.foord set nosy: - michael.foord
2010-11-06 05:38:30 eric.araujo set nosy: + giampaolo.rodola, eric.araujo, michael.foordmessages: +
2010-10-29 10:11:51 pitrou create