shelve ( or bsddb ) problem

Alex A. Nikiforov nikifor at sky.inp.nsk.su
Sun Jun 24 18:18:36 CEST 2001


That is priogram:

$ cat b.py
import bsddb
import shelve

s = shelve.BsdDbShelf(bsddb.hashopen('qqqqa','c'))
s['a'] = [3,2,1]
print s['a']
s['a'] = [1,2,3]
print s['a']
s['a'] = range(1000)
print s['a'][500]
s['a'] = [1,2,3]
print s['a']

That is result:

$ python b.py
[3, 2, 1]
[1, 2, 3]
500
Traceback (innermost last):
  File "b.py", line 12, in ?
    print s['a']    
  File "/usr/lib/python1.5/shelve.py", line 64, in __getitem__
    f = StringIO(self.dict[key])
KeyError: a
$

? ? ? ? ?

python-1.5.2-30 from RedHat

(python-1.5.2-27 has the same problem too)

Alexei Nikiforov



More information about the Python-list mailing list