[Python-Dev] Re: Distutils confuses Berkeley DB and dbm?

Skip Montanaro skip@pobox.com
Thu, 30 May 2002 21:51:20 -0500


Okay, after a little investigation (about 30 seconds staring at setup.py), I
see where the problem with dbm is.  Setup.py has this code to deal with dbm:

     # The standard Unix dbm module:
     if platform not in ['cygwin']:
         if (self.compiler.find_library_file(lib_dirs, 'ndbm')):
             exts.append( Extension('dbm', ['dbmmodule.c'],
                                    libraries = ['ndbm'] ) )
         elif self.compiler.find_library_file(lib_dirs, 'db1'):
             exts.append( Extension('dbm', ['dbmmodule.c'],
                                    libraries = ['db1'] ) )
         else:
             exts.append( Extension('dbm', ['dbmmodule.c']) )

That second branch is just plain wrong.  (I realize Neil added it in
response to a bug report.)  While it's true that Berkeley DB does (or did)
provide a dbm API, the underlying file is a db1 hash file, which we all
should realize by now is horribly broken, and if you've got a workable bsddb
there's no sense in trying to trick programmers into thinking they also have
real dbm files.  I suggest we discard the elif branch.  Any argument?

Skip