test_bsddb185 failing under OS X
====================================================================== FAIL: test_anydbm_create (__main__.Bsddb185Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_bsddb185.py", line 35, in test_anydbm_create self.assertNotEqual(ftype, "bsddb185") File "/Users/drifty/cvs_code/lib/python2.3/unittest.py", line 300, in failIfEqual raise self.failureException, \ AssertionError: 'bsddb185' == 'bsddb185' DBs are not my area of expertise so I don't know how to go about to attempt to fix this. -Brett
Brett> AssertionError: 'bsddb185' == 'bsddb185' Brett> DBs are not my area of expertise so I don't know how to go about Brett> to attempt to fix this. I'll look into it. Skip
Brett, I goofed a bit in my (private) note to you yesterday. anydbm._name isn't of interest. It's anydbm._defaultmod. On my system, if I mv Lib/bsddb to Lib/bsddb- I no longer have the bsddb package available (as you said you didn't). In that situation, for me, anydbm._defaultmod is the gdbm module. All three tests succeed: % ./python.exe ../Lib/test/test_bsddb185.py test_anydbm_create (__main__.Bsddb185Tests) ... ok test_open_existing_hash (__main__.Bsddb185Tests) ... ok test_whichdb (__main__.Bsddb185Tests) ... ok If I delete gdbm.so I get dbm as anydbm._defaultmod. Again, success: % ./python.exe ../Lib/test/test_bsddb185.py test_anydbm_create (__main__.Bsddb185Tests) ... ok test_open_existing_hash (__main__.Bsddb185Tests) ... ok test_whichdb (__main__.Bsddb185Tests) ... ok Delete dbm.so. Run again. Now dumbdbm is anydbm._defaultmod. Run again. Success again: % ./python.exe ../Lib/test/test_bsddb185.py test_anydbm_create (__main__.Bsddb185Tests) ... ok test_open_existing_hash (__main__.Bsddb185Tests) ... ok test_whichdb (__main__.Bsddb185Tests) ... ok In short, I can't reproduce your error. Can you do some more debugging to see why your anydbm.open seems to be calling bsddb185.open? Thx, Skip
Skip Montanaro wrote:
Brett,
I goofed a bit in my (private) note to you yesterday. anydbm._name isn't of interest. It's anydbm._defaultmod.
anydbm._defaultmod <module 'dbm' from '/Users/drifty/cvs_code/lib/python2.3/lib-dynload/dbm.so'>
On my system, if I mv Lib/bsddb to Lib/bsddb- I no longer have the bsddb package available (as you said you didn't). In that situation, for me, anydbm._defaultmod is the gdbm module. All three tests succeed:
% ./python.exe ../Lib/test/test_bsddb185.py test_anydbm_create (__main__.Bsddb185Tests) ... ok test_open_existing_hash (__main__.Bsddb185Tests) ... ok test_whichdb (__main__.Bsddb185Tests) ... ok
If I delete gdbm.so I get dbm as anydbm._defaultmod. Again, success:
% ./python.exe ../Lib/test/test_bsddb185.py test_anydbm_create (__main__.Bsddb185Tests) ... ok test_open_existing_hash (__main__.Bsddb185Tests) ... ok test_whichdb (__main__.Bsddb185Tests) ... ok
Delete dbm.so. Run again. Now dumbdbm is anydbm._defaultmod. Run again. Success again:
No success for me when it is using dumbdbm: ====================================================================== ERROR: test_anydbm_create (__main__.Bsddb185Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_bsddb185.py", line 39, in test_anydbm_create os.rmdir(tmpdir) OSError: [Errno 66] Directory not empty: '/tmp/tmpkiVKcZ' ---------------------------------------------------------------------- Looks like foo.dat and foo.dir are left (files used by the DB?). I will fix the test again to be more agressive about deleting files. ... done. Just used shutil.rmtree instead of the nested 'try' statements that called os.unlink and os.rmdir . Now the tests pass for dumbdbm. So it seems to be dbm.so for some reason. I will see what I can figure out or at least get as much info as I can that I think can help in debugging this. -Brett
Brett C. wrote:
No success for me when it is using dumbdbm:
====================================================================== ERROR: test_anydbm_create (__main__.Bsddb185Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_bsddb185.py", line 39, in test_anydbm_create os.rmdir(tmpdir) OSError: [Errno 66] Directory not empty: '/tmp/tmpkiVKcZ'
----------------------------------------------------------------------
Looks like foo.dat and foo.dir are left (files used by the DB?). I will fix the test again to be more agressive about deleting files.
... done. Just used shutil.rmtree instead of the nested 'try' statements that called os.unlink and os.rmdir . Now the tests pass for dumbdbm. So it seems to be dbm.so for some reason.
But then Skip checked in the exact change I was going to I think almost simultaneously. And guess what? Now the darned tests pass using dbm! I am going to do a completely clean compile and test again to make sure this is not a fluke since the only change was ``cvs update`` for test_bsddb185.py and that only changed how files were deleted. Ah, the joys of coding. -Brett
Brett C. wrote:
But then Skip checked in the exact change I was going to I think almost simultaneously. And guess what? Now the darned tests pass using dbm! I am going to do a completely clean compile and test again to make sure this is not a fluke since the only change was ``cvs update`` for test_bsddb185.py and that only changed how files were deleted.
Well, I recompiled and the test is still passing. The only thing I am aware of that changed between the tests failing and passing was me changing the test to use shutil.rmtree to clean up after itself and renaming dbm.so and then putting its name back. I have no idea why it is working now, but it is. -Brett
Brett> No success for me when it is using dumbdbm: Brett> ====================================================================== Brett> ERROR: test_anydbm_create (__main__.Bsddb185Tests) Brett> ---------------------------------------------------------------------- Brett> Traceback (most recent call last): Brett> File "Lib/test/test_bsddb185.py", line 39, in test_anydbm_create Brett> os.rmdir(tmpdir) Brett> OSError: [Errno 66] Directory not empty: '/tmp/tmpkiVKcZ' This problem is fixed in CVS. Have you updated? Brett> ... done. Just used shutil.rmtree instead of the nested 'try' Brett> statements that called os.unlink and os.rmdir . Now the tests Brett> pass for dumbdbm. So it seems to be dbm.so for some reason. This is just what I checked in. Skip
Yee haw! All expected tests pass for me w/ Python 2.3cvs on OSX 10.2.6. Gonna try Python 2.2.3 next. -Barry
participants (3)
-
Barry Warsaw -
Brett C. -
Skip Montanaro