Kaydet (Commit) 5b8bfdf6 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Patch #755087: Deal with emptied dumbdbm files correctly.

üst 171be76b
......@@ -51,10 +51,10 @@ def whichdb(filename):
# Check for dumbdbm next -- this has a .dir and and a .dat file
try:
# First check for presence of files
sizes = os.stat(filename + os.extsep + "dat").st_size, \
os.stat(filename + os.extsep + "dir").st_size
os.stat(filename + os.extsep + "dat")
size = os.stat(filename + os.extsep + "dir").st_size
# dumbdbm files with no keys are empty
if sizes == (0, 0):
if size == 0:
return "dumbdbm"
f = open(filename + os.extsep + "dir", "rb")
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment