[Mailman-Users] what DB format is config.db?

Barry A. Warsaw barry at zope.com
Wed Aug 1 08:43:13 CEST 2001


Just to clarify what Dan Mick says in

http://mail.python.org/pipermail/mailman-users/2001-July/013139.html

config.db and in fact all .db files Mailman writes, are technically
marshals containg one Python object, a dictionary.  Python has a
low-level object serialization protocol called "marshal", and a module
that implements this.  Marshals are a way to serialize basic objects
such as integers, floats, strings, lists, tuples, and dictionaries.
There is a higher level protocol called "pickle" (in MM2.1, .pck
files) which knows how to properly serialize more complex objects like
instances, object trees, etc.  Because config.db is a simple
dictionary mapping strings to basic objects, marshal was used here,
and this is the case with a few other .db files Mailman uses.

Contrast this with MM2.1 where messages need to be read and written
possibly more than once.  The first time a message is read from disk,
it is plain text, so it needs to be parsed and turned into an object
tree, via mimelib.  It would be inefficient to write back to plain
text, just to reparse again later, so Mailman writes the object tree
back to disk as a pickle, making it much faster to reload later.

-Barry




More information about the Mailman-Users mailing list