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

Guido van Rossum guido@python.org
Fri, 31 May 2002 00:57:54 -0400


> 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?

Sounds reasonable to me, but I'm no expert in this area.  (I still
have a pending bug report on why whichdb gets confused sometimes.)

--Guido van Rossum (home page: http://www.python.org/~guido/)