title: shelve db type could not be determined, whichdb is not recognizing gdb
body: <p>Why shelve raise an error if I try to open a file just created by shelve?</p>
  
  <pre><code>import shelve
  info_file_name = "/Users/bacon/myproject/temp/test.info"
  
  info_file = shelve.open(info_file_name)
  info_file['ok'] = 'wass'
  info_file.close()
  
  info_file = shelve.open(info_file_name) # raise exception db type could not be determined..
  info_file.close()
  </code></pre>
  
  <p>I'm running python 2.5 in case is relevant</p>
  
  <p>The precise error is raising is:</p>
  
  <p><code>db type could not be determined</code> its raised by <code>anydbm.py</code> <code>open</code> method.</p>
  
  <p>I know it;s using gdbm. I checked on the whichdb.py file, and it tries to identify gdbm files with this</p>
  
  <pre><code> # Read the start of the file -- the magic number
  s16 = f.read(16)
  s = s16[0:4]
  
  # Convert to 4-byte int in native byte order -- return "" if impossible
  (magic,) = struct.unpack("=l", s)
  
  # Check for GNU dbm
  if magic == 0x13579ace:
      return "gdbm"
  </code></pre>
  
  <p>But the "magic" number in my file is <code>324508367</code> (<code>0x13579acf</code>) (<em>only the last digit change!!</em>)</p>
  
  <p>I tried opening the file with another language (ruby) and I were able to open it without any problem, so this seems to be a bug in whichdb.py trying to identify the correct dbm</p>