[Python-checkins] python/dist/src/Lib dumbdbm.py,1.24,1.25

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sat, 12 Jul 2003 19:05:49 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv17744/Lib

Modified Files:
	dumbdbm.py 
Log Message:
More comments about why not closing a dumddbm properly can be a disaster.


Index: dumbdbm.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dumbdbm.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** dumbdbm.py	12 Jul 2003 20:23:09 -0000	1.24
--- dumbdbm.py	13 Jul 2003 02:05:47 -0000	1.25
***************
*** 129,134 ****
  
      # key is a new key whose associated value starts in the data file
!     # at offset pos and with length size.  Add an index record to
!     # the in-memory index dict, and append one to the index file.
      def _addkey(self, key, pos_and_siz_pair):
          self._index[key] = pos_and_siz_pair
--- 129,134 ----
  
      # key is a new key whose associated value starts in the data file
!     # at offset pos and with length siz.  Add an index record to
!     # the in-memory index dict, and append one to the directory file.
      def _addkey(self, key, pos_and_siz_pair):
          self._index[key] = pos_and_siz_pair
***************
*** 158,162 ****
              # Note that _index may be out of synch with the directory
              # file now:  _setval() and _addval() don't update the directory
!             # file.
  
      def __delitem__(self, key):
--- 158,166 ----
              # Note that _index may be out of synch with the directory
              # file now:  _setval() and _addval() don't update the directory
!             # file.  This also means that the on-disk directory and data
!             # files are in a mutually inconsistent state, and they'll
!             # remain that way until _commit() is called.  Note that this
!             # is a disaster (for the database) if the program crashes
!             # (so that _commit() never gets called).
  
      def __delitem__(self, key):