Ray.Allen <[email protected]> added the comment:
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))
----------
nosy: +ysj.ray
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue10228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com