Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
02cd3658
Commit
02cd3658
authored
May 06, 2003
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detect old version 2 hash files and return "bsddb185" as the appropriate
module to load them
parent
6d9f45bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Lib/whichdb.py
Lib/whichdb.py
+4
-3
No files found.
Lib/whichdb.py
View file @
02cd3658
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment