[Patches] [ python-Patches-723231 ] __del__ in dumbdbm fails under some circumstances

SourceForge.net noreply@sourceforge.net
Sat, 12 Jul 2003 18:53:27 -0700


Patches item #723231, was opened at 2003-04-17 13:02
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=723231&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
>Priority: 7
Submitted By: Tim Stone (timstone4)
Assigned to: Tim Peters (tim_one)
Summary: __del__ in dumbdbm fails under some circumstances

Initial Comment:
Using dumbdbm for simple testing, I occasionally get the following 
error:

Exception exceptions.AttributeError: "'NoneType' 
object has no attribute 'error'
" in <bound method 
_Database.__del__ of <dumbdbm._Database instance at 
0x008B356
8>> ignored

I've tracked it down to a 
problem with the releasing of the reference to _os during __del__, 
which then calls _commit.  _commit proceeds to use the _os, 
which is given a value of None... blamo...

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2003-07-12 21:53

Message:
Logged In: YES 
user_id=31435

I didn't pay attention to it, but it is an obvious shutdown 
race.  I'll fix it.  Tim Stone (the OP) is a contributor to the 
spambayes project, and it turns out this is damned important 
in spambayes, because it appears the spambayes code never 
calls the dumbdbm.close() method explicitly.  Something else I 
learned from the dumbdbm review is that a dumbdbm's disk 
files routinely get out of synch with each other, and rely on 
someone calling close() or __del__() to get them back in 
synch.  If a .bak file doesn't already exist, though, this 
shutdown race can prevent __del__() from synch'ing the files.

Boosted priority.

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-12 21:37

Message:
Logged In: YES 
user_id=80475

Tim, did you see this during your review of dumbdbm?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=723231&group_id=5470