Using anydbm.

Jordan Katz webmaster at underlevel.net
Mon May 29 18:16:12 EDT 2000


Hi,

I'm having trouble getting anydbm to work correctly.  For example, 

  >>> import anydbm
  >>> db = anydbm.open('foo', 'c')
  >>> db['bar'] = 'baz'
  >>> db['bar']
  'baz'

Works fine, but if I try to execute it again after restarting python,
I get the error:

  Traceback (innermost last):
    File "<stdin>", line 1, in ?
    File "/usr/lib/python1.5/anydbm.py", line 83, in open
      raise error, "db type could not be determined"
  anydbm.error: db type could not be determined

_Programming Python_ specifically gives an example of this which
should work correctly according to the author.  I have also tried
changing the 'c' argument to anydbm.open() to 'r', but I got the same
results.

Thanks,
-- 
Jordan Katz <webmaster at underlevel.net>



More information about the Python-list mailing list