diff options
| author | bwarsaw | 2001-10-04 14:29:32 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-10-04 14:29:32 +0000 |
| commit | 912ae063f5e7e1408940a1ab93136c7a4da99b9e (patch) | |
| tree | 6975945ab2ce1cf698814f02359a1639ee32e5c8 /contrib/securelinux_fix.py | |
| parent | 36e6164d16f43ca48e46d3fd4a244b3a222e7a62 (diff) | |
| download | mailman-912ae063f5e7e1408940a1ab93136c7a4da99b9e.tar.gz mailman-912ae063f5e7e1408940a1ab93136c7a4da99b9e.tar.zst mailman-912ae063f5e7e1408940a1ab93136c7a4da99b9e.zip | |
Switch to using binary cpickles as the config file data format.
Marshal is not guaranteed to be compatible across Python versions, and
while I'm not aware of any breakage since Py1.5.2, better to be
defensive here.
Specific changes include:
__save(): Dump the dict to the file as a binary cPickle. Do the dump
directly instead of dumping a string to fp.write() since -- I hope
-- cPickle doesn't suffer from the same problem as the comment
describes marshal as suffering from (I don't actually remember the
details of that).
__load(): Teach this method how to load .pck (i.e. config.pck) pickle
files, but retain the ability to load .db marshal files for
automatic upgrade. Also, add a catch of cPickle.PicklingError to
the big except clause.
Load(): Teach this how to load .pck and .db files, always defaulting
to .pck first. If the primary file was ever corrupt and we had to
load from the .last file, we'll make a copy of .last to a .safety
file just in case.
Diffstat (limited to 'contrib/securelinux_fix.py')
0 files changed, 0 insertions, 0 deletions
