[Python-Dev] test_bsddb185 failing under OS X

Brett C. drifty@alum.berkeley.edu
Sat, 17 May 2003 11:13:15 -0700


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