I am trying to add a dicts file to a shelf file:
>>> d = shelve.open('index.shelve') >>> d <shelve.DbfilenameShelf object at 0x21965f0> >>> print(list(d.keys())) [] >>> d['index'] = index Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/bns/rma/local/python/lib/python3.1/shelve.py", line 124, in __setitem__ self.dict[key.encode(self.keyencoding)] = f.getvalue() _dbm.error: cannot add item to database
the index is somewhat large, but not huge. This is essentially an array of floats:
>>> len(index) 219 >>> a = [ index[k][k1] for k in index for k1 in index[k] ] >>> len(a) 59995 >>> all([ type(x) is float for x in a ]) True
What is this mistake? Also, is there somewhere inside the module or module documentation I have to look to find out more about what the error represents? The error message is not very informative, at least for me :).
source share