[spambayes-dev] A new and altogether different bsddb breakage

Tim Peters tim.one at comcast.net
Thu Dec 18 19:09:45 EST 2003

[Kenny Pitt]
> So are you recommending that we avoid using the whole _bsddb.pyd
> binary package?  I originally thought you were referring only to the
> Python-coded wrappers.

We need _bsddb.pyd to use a modern BDB at all from within Python on Windows.
I'm not familiar with what all is in that DLL, but there certainly aren't
any Python-coded wrappers in it.  It's about 5000 lines worth of compiled C
code, and wraps Sleepycat's C API so that it can be called from Python.
Most of it consists of short wrapper functions calling Sleepycat functions
with similar names, just converting raw C bits to and from Python objects at
the boundaries ...

Hmm.  Maybe you're not aware of this:


That's effictively the *real* documentation for Python's modern Berkeley
module.  It hasn't been folded into the Python doc set yet.  _bsddb.pyd is
intended to provide quite directs way of calling the native Sleepycat API
functions.  The *Python* docs never get around to explaining that, so if
that's what you've been looking at, you've been looking at old docs
describing lots of "legacy tricks" last updated for Berkeley 1.85, around
the time of the last asteroid-induced mass extinction event <wink>.

I'm suggesting avoiding the legacy tricks, avoiding the slow & buggy stuff
trying to make current BDB "act just like a magical Python dict", and
writing as directly as possible to Sleepycat's C API (which, I hasten to
add, is much easier from Python than from C).  Barry will testify it's not
that bad, and since he's actually done it in a much more difficult (wrt
database demands) project, I believe him.  Sleepycat BDB has its own idioms
and rhythms, and I'd like us to try to play along with them instead of
fighting, or trying to hide, them.

More information about the spambayes-dev mailing list