Shelve and Object Size

Curtis Jensen cjensen at bioeng.ucsd.edu
Thu Aug 10 16:28:11 EDT 2000


Is there a limit on the size of an object that shelve can handle?  For
example:

>>> import shelve
>>> from Numeric import *
>>> writer = shelve.open ( 'my_db' )
>>> writer['2'] = zeros([2])
>>> writer['big'] = zeros([1000000])
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/usr/local/Python/lib/python1.5/shelve.py", line 71, in
__setitem__
    self.dict[key] = f.getvalue()
dbm.error: Cannot add item to database

I need to but some rather large Python objects into a database.  I
thought shelve would be the easiest way.  How should I do this?  Can I
make shelve work, or should I use something different?  Thanks.

-- 
Curtis Jensen
cjensen at bioeng.ucsd.edu
http://www-bioeng.ucsd.edu/~cjensen/
FAX (425) 740-1451



More information about the Python-list mailing list