From: Skip Montanaro Date: Mon, 14 Jul 2003 12:15:15 +0000 (+0000) Subject: Give dumbdbm a sync() method which Shelve can call. Should solve some X-Git-Tag: v2.3c1~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d06815b562e1540ee334d30953354210dfebd24;p=python Give dumbdbm a sync() method which Shelve can call. Should solve some database corruption problems with Spambayes. --- diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py index 7b4ddb02fb..b85844dc61 100644 --- a/Lib/dumbdbm.py +++ b/Lib/dumbdbm.py @@ -110,6 +110,8 @@ class _Database(UserDict.DictMixin): f.write("%r, %r\n" % (key, pos_and_siz_pair)) f.close() + sync = _commit + def __getitem__(self, key): pos, siz = self._index[key] # may raise KeyError f = _open(self._datfile, 'rb')