]> granicus.if.org Git - python/commitdiff
detect old version 2 hash files and return "bsddb185" as the appropriate
authorSkip Montanaro <skip@pobox.com>
Tue, 6 May 2003 20:42:10 +0000 (20:42 +0000)
committerSkip Montanaro <skip@pobox.com>
Tue, 6 May 2003 20:42:10 +0000 (20:42 +0000)
module to load them

Lib/whichdb.py

index cc95ed512f52ccfd66bab80a8272b13c3bce557f..fed58e943b07d3c3820e434b6f762fecbce5354b 100644 (file)
@@ -86,11 +86,12 @@ def whichdb(filename):
     if magic == 0x13579ace:
         return "gdbm"
 
-    # Check for BSD hash
+    # Check for old Berkeley db hash file format v2
     if magic in (0x00061561, 0x61150600):
-        return "dbhash"
+        return "bsddb185"
 
-    # BSD hash v2 has a 12-byte NULL pad in front of the file type
+    # Later versions of Berkeley db hash file have a 12-byte pad in
+    # front of the file type
     try:
         (magic,) = struct.unpack("=l", s16[-4:])
     except struct.error: