Bugs item #1396678, was opened at 2006-01-04 10:56
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1396678&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Fabian_M (fmareyen)
Assigned to: Nobody/Anonymous (nobody)
Summary: bsddb.__init__ causes error
Initial Comment:
I've found an Error in the bsddb.__init__.py-module:
pythonversion = 2.4 (problem may also be in version 2.3)
After creating and closing a db with bsddb.hashopen I
called globals().
Next there occured an Error:
#Error-Message
---------------------------------------------
>>> globals()
{'__builtins__': <module '__builtin__' (built-in)>,
'f4': <function f4 at 0x00B5A130>, 'dbtest1': Traceback
(most recent call last):
File "<stdin>", line 1, in ?
File "D:\Programme\python24\lib\UserDict.py", line
162, in __repr__
return repr(dict(self.iteritems()))
File "<string>", line 46, in iteritems
File "<string>", line 4, in _make_iter_cursor
AttributeError: 'NoneType' object has no attribute 'cursor'
>>>
----------------------------------------------
#Way of the Error
The way of the Error is:
1.
globals() asked for bsddb._DBWithCursor.__repr__ with
the __repr__-method inherriting from bsddb._iter_mixin
based on UserDict.DictMixin.
2.
The __repr__-method in UserDict.DictMixin at line 162
calls self.iteritems overwritten by
bsddb._iter_mixin.iteritems at line 113.
3.
This method calls self._make_iter_cursor (line 115).
bsddb._iter_mixin._make_iter_cursor calls bsddb.db
which was set to None at closing the bd with db.close()
at line 223.
#Solution:
That way the error was created. To avoid this, the
bsddb._iter_mixin.iteritems-method should be something
like this:
-------------------------
def iteritems(self):
if not self.db:
return ""
try:
cur = self._make_iter_cursor()
...
...
-------------------------
----------------------------------------------------------------------
>Comment By: Georg Brandl (birkenfeld)
Date: 2006-02-19 01:54
Message:
Logged In: YES
user_id=1188172
Thanks for the report. Fixed in rev. 42480.
----------------------------------------------------------------------
Comment By: Fabian_M (fmareyen)
Date: 2006-01-08 18:07
Message:
Logged In: YES
user_id=1418961
I've added an example-file.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2006-01-05 06:54
Message:
Logged In: YES
user_id=33168
Can you attach a complete test case which demonstrates this
behaviour?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1396678&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com