summaryrefslogtreecommitdiff
path: root/Lib/whichdb.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-05-06 20:42:10 +0000
committerSkip Montanaro <skip@pobox.com>2003-05-06 20:42:10 +0000
commit39ec1ffdf469153922b5c68ed0efb725008499b4 (patch)
tree0cb13efc6a79e5f375acfea758098201d606d3d9 /Lib/whichdb.py
parentb95decc13f19a7c3abb8630d444b319108b8ad59 (diff)
downloadcpython-39ec1ffdf469153922b5c68ed0efb725008499b4.tar.gz
detect old version 2 hash files and return "bsddb185" as the appropriate
module to load them
Diffstat (limited to 'Lib/whichdb.py')
-rw-r--r--Lib/whichdb.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/whichdb.py b/Lib/whichdb.py
index cc95ed512f..fed58e943b 100644
--- a/Lib/whichdb.py
+++ b/Lib/whichdb.py
@@ -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: