[pybsddb] _bsddb.DBNotFoundError: (-30990, 'DB_NOTFOUND: No matching key/data pair found')
wave2050
wave2050 at gmail.com
Tue Mar 11 09:49:25 CET 2008
>>> import bsddb
>>> a = bsddb.btopen("aaa.db", 'c')
>>> dir(a)
['__cmp__', '__contains__', '__del__', '__delitem__', '__doc__',
'__getitem__', '__init__', '__iter__', '__len__', '__module__', '__repr__',
'__setitem__', '_checkCursor', '_checkOpen', '_closeCursors',
'_cursor_refs', '_gen_cref_cleaner', '_make_iter_cursor', 'clear', 'close',
'db', 'dbc', 'first', 'get', 'has_key', 'isOpen', 'items', 'iteritems',
'iterkeys', 'itervalues', 'keys', 'last', 'next', 'pop', 'popitem',
'previous', 'saved_dbc_key', 'set_location', 'setdefault', 'sync', 'update',
'values']
>>> a['11'] = 'xxx'
>>> print a
{'11': 'xxx'}
>>> a.keys()
['11']
>>> a.first()
('11', 'xxx')
>>> a['bbb'] = 'rrr'
>>> a['tttt'] = '555555555'
>>> print a
{'11': 'xxx', 'tttt': '555555555', 'bbb': 'rrr'}
>>> a.first()
('11', 'xxx')
>>> a.pop('11')
'xxx'
>>> print a
{'tttt': '555555555', 'bbb': 'rrr'}
>>> print a.first()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/bsddb/__init__.py", line 277, in first
self._checkCursor()
File "/usr/lib/python2.5/bsddb/__init__.py", line 187, in _checkCursor
_DeadlockWrap(self.dbc.set, self.saved_dbc_key)
File "/usr/lib/python2.5/bsddb/dbutils.py", line 62, in DeadlockWrap
return function(*_args, **_kwargs)
_bsddb.DBNotFoundError: (-30990, 'DB_NOTFOUND: No matching key/data pair
found')
>>> a.first()
('bbb', 'rrr')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20080311/a2cf84e7/attachment.html>
More information about the pybsddb
mailing list