anydbm behaves somewhat odd.

Fedor Baart fedor at mailandnews.com
Thu Oct 10 18:02:04 EDT 2002


I am trying to use anydbm with Python 2.2.1 on winxp. If I use the anydbm
module (which creates a bsddb hashtable) . If I try to write data to it , it
sometimes fails.
The problem seems to be that only a maximum length can be written to a bsddb
table. For example:

This works:

import anydbm
dbm=anydbm.open('anydbm.dbm','n')
dbm['a']='a'*63245
dbm.close()
dbm=anydbm.open('anydbm.dbm','r')
print dbm.keys()

This does not:

import anydbm
dbm=anydbm.open('anydbm.dbm','n')
dbm['a']='a'*63246 #This seems to be the maximum length?!
dbm.close()
dbm=anydbm.open('anydbm.dbm','r')
print dbm.keys()

Any help would be appreciated.

Fedor Baart





More information about the Python-list mailing list