shelve ( or bsddb ) problem

Roman Suzi rnd at onego.ru
Sun Jun 24 13:12:02 EDT 2001


On 24 Jun 2001, Alex A. Nikiforov wrote:

>
>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)


$ rpm -q python
python-1.5.2-13

- No problem here:

[3, 2, 1]
[1, 2, 3]
500
[1, 2, 3]


Run:

rpm -Vf /usr/lib/python1.5/shelve.py

to check Python installation.

>Alexei Nikiforov
>

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Sunday, June 24, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "Ok, I pulled the pin. Now what? Where are you going?" _/





More information about the Python-list mailing list